// $ANTLR 3.1.1 RiseCollectionFormula.g 2009-12-24 15:26:40

package cn.newtest.bi.collection.formula.antlr;



import org.antlr.runtime.BaseRecognizer;
import org.antlr.runtime.BitSet;
import org.antlr.runtime.DFA;
import org.antlr.runtime.IntStream;
import org.antlr.runtime.MismatchedSetException;
import org.antlr.runtime.NoViableAltException;
import org.antlr.runtime.ParserRuleReturnScope;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.RecognizerSharedState;
import org.antlr.runtime.Token;
import org.antlr.runtime.TokenStream;
import org.antlr.runtime.tree.CommonTreeAdaptor;
import org.antlr.runtime.tree.RewriteEarlyExitException;
import org.antlr.runtime.tree.RewriteRuleSubtreeStream;
import org.antlr.runtime.tree.RewriteRuleTokenStream;
import org.antlr.runtime.tree.TreeAdaptor;

public class RiseCollectionFormulaParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "DECINODE", "FOR", "ENDFOR", "FOREACH", "ENDFOREACH", "IF", "ENDIF", "ELSE", "Identifier", "AS", "OPEN", "DecimalLiteral", "LY", "SURE", "StringLiteral", "IN", "TO", "RANGECELL", "INDICATIONCELL", "ZZJGDM", "TBR", "BGQ", "TBRQ", "QYMC", "LEN", "NOTEMPTY", "EMPTY", "ABS", "RPCELL", "Letter", "FloatingPointLiteral", "CharacterLiteral", "EscapeSequence", "UnicodeEscape", "OctalEscape", "HexDigit", "WS", "COMMENT", "LINE_COMMENT", "'='", "'.'", "'-'", "'('", "')'", "','", "'['", "']'", "'||'", "'&&'", "'=='", "'!='", "'<>'", "'>='", "'<='", "'>'", "'<'", "'+'", "'*'", "'/'", "'%'", "'+...+'", "'null'", "'true'", "'false'"
    };
    public static final int AS=13;
    public static final int T__57=57;
    public static final int HexDigit=39;
    public static final int ZZJGDM=23;
    public static final int T__51=51;
    public static final int T__47=47;
    public static final int T__50=50;
    public static final int T__65=65;
    public static final int TBRQ=26;
    public static final int T__67=67;
    public static final int Letter=33;
    public static final int TO=20;
    public static final int T__52=52;
    public static final int T__46=46;
    public static final int T__62=62;
    public static final int EscapeSequence=36;
    public static final int T__49=49;
    public static final int T__61=61;
    public static final int DECINODE=4;
    public static final int T__59=59;
    public static final int T__54=54;
    public static final int T__48=48;
    public static final int LEN=28;
    public static final int FloatingPointLiteral=34;
    public static final int QYMC=27;
    public static final int T__56=56;
    public static final int ENDIF=10;
    public static final int EMPTY=30;
    public static final int TBR=24;
    public static final int Identifier=12;
    public static final int WS=40;
    public static final int CharacterLiteral=35;
    public static final int T__58=58;
    public static final int BGQ=25;
    public static final int T__64=64;
    public static final int ENDFOR=6;
    public static final int T__44=44;
    public static final int ENDFOREACH=8;
    public static final int T__66=66;
    public static final int COMMENT=41;
    public static final int LY=16;
    public static final int StringLiteral=18;
    public static final int LINE_COMMENT=42;
    public static final int RANGECELL=21;
    public static final int T__55=55;
    public static final int T__45=45;
    public static final int IN=19;
    public static final int UnicodeEscape=37;
    public static final int INDICATIONCELL=22;
    public static final int ABS=31;
    public static final int T__63=63;
    public static final int ELSE=11;
    public static final int NOTEMPTY=29;
    public static final int T__43=43;
    public static final int IF=9;
    public static final int OPEN=14;
    public static final int EOF=-1;
    public static final int RPCELL=32;
    public static final int T__53=53;
    public static final int DecimalLiteral=15;
    public static final int SURE=17;
    public static final int FOR=5;
    public static final int OctalEscape=38;
    public static final int T__60=60;
    public static final int FOREACH=7;

    // delegates
    // delegators


        public RiseCollectionFormulaParser(TokenStream input) {
            this(input, new RecognizerSharedState());
        }
        public RiseCollectionFormulaParser(TokenStream input, RecognizerSharedState state) {
            super(input, state);
             
        }
        
    protected TreeAdaptor adaptor = new CommonTreeAdaptor();

    public void setTreeAdaptor(TreeAdaptor adaptor) {
        this.adaptor = adaptor;
    }
    public TreeAdaptor getTreeAdaptor() {
        return adaptor;
    }

    public String[] getTokenNames() { return RiseCollectionFormulaParser.tokenNames; }
    public String getGrammarFileName() { return "RiseCollectionFormula.g"; }


    public static class prog_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "prog"
    // RiseCollectionFormula.g:22:1: prog : ( statement )* EOF ;
    public final RiseCollectionFormulaParser.prog_return prog() throws RecognitionException {
        RiseCollectionFormulaParser.prog_return retval = new RiseCollectionFormulaParser.prog_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token EOF2=null;
        RiseCollectionFormulaParser.statement_return statement1 = null;


        Object EOF2_tree=null;

        try {
            // RiseCollectionFormula.g:22:6: ( ( statement )* EOF )
            // RiseCollectionFormula.g:22:8: ( statement )* EOF
            {
            root_0 = (Object)adaptor.nil();

            // RiseCollectionFormula.g:22:8: ( statement )*
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==FOR||LA1_0==FOREACH||LA1_0==IF||LA1_0==Identifier||LA1_0==OPEN||LA1_0==SURE||(LA1_0>=RANGECELL && LA1_0<=INDICATIONCELL)) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // RiseCollectionFormula.g:0:0: statement
            	    {
            	    pushFollow(FOLLOW_statement_in_prog51);
            	    statement1=statement();

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, statement1.getTree());

            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);

            EOF2=(Token)match(input,EOF,FOLLOW_EOF_in_prog54); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            EOF2_tree = (Object)adaptor.create(EOF2);
            adaptor.addChild(root_0, EOF2_tree);
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "prog"

    public static class statement_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "statement"
    // RiseCollectionFormula.g:25:1: statement : ( ifStatement | FOR inListStatement ( statement )* ENDFOR -> ^( FOR inListStatement ( statement )* ) | FOREACH ( statement )* ENDFOREACH -> ^( FOREACH ( statement )* ) | assignStatement | asAssignStatement | openStatement | functionStatement );
    public final RiseCollectionFormulaParser.statement_return statement() throws RecognitionException {
        RiseCollectionFormulaParser.statement_return retval = new RiseCollectionFormulaParser.statement_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token FOR4=null;
        Token ENDFOR7=null;
        Token FOREACH8=null;
        Token ENDFOREACH10=null;
        RiseCollectionFormulaParser.ifStatement_return ifStatement3 = null;

        RiseCollectionFormulaParser.inListStatement_return inListStatement5 = null;

        RiseCollectionFormulaParser.statement_return statement6 = null;

        RiseCollectionFormulaParser.statement_return statement9 = null;

        RiseCollectionFormulaParser.assignStatement_return assignStatement11 = null;

        RiseCollectionFormulaParser.asAssignStatement_return asAssignStatement12 = null;

        RiseCollectionFormulaParser.openStatement_return openStatement13 = null;

        RiseCollectionFormulaParser.functionStatement_return functionStatement14 = null;


        Object FOR4_tree=null;
        Object ENDFOR7_tree=null;
        Object FOREACH8_tree=null;
        Object ENDFOREACH10_tree=null;
        RewriteRuleTokenStream stream_FOR=new RewriteRuleTokenStream(adaptor,"token FOR");
        RewriteRuleTokenStream stream_ENDFOR=new RewriteRuleTokenStream(adaptor,"token ENDFOR");
        RewriteRuleTokenStream stream_ENDFOREACH=new RewriteRuleTokenStream(adaptor,"token ENDFOREACH");
        RewriteRuleTokenStream stream_FOREACH=new RewriteRuleTokenStream(adaptor,"token FOREACH");
        RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
        RewriteRuleSubtreeStream stream_inListStatement=new RewriteRuleSubtreeStream(adaptor,"rule inListStatement");
        try {
            // RiseCollectionFormula.g:26:2: ( ifStatement | FOR inListStatement ( statement )* ENDFOR -> ^( FOR inListStatement ( statement )* ) | FOREACH ( statement )* ENDFOREACH -> ^( FOREACH ( statement )* ) | assignStatement | asAssignStatement | openStatement | functionStatement )
            int alt4=7;
            switch ( input.LA(1) ) {
            case IF:
                {
                alt4=1;
                }
                break;
            case FOR:
                {
                alt4=2;
                }
                break;
            case FOREACH:
                {
                alt4=3;
                }
                break;
            case RANGECELL:
            case INDICATIONCELL:
                {
                alt4=4;
                }
                break;
            case Identifier:
                {
                int LA4_5 = input.LA(2);

                if ( (LA4_5==43) ) {
                    alt4=4;
                }
                else if ( (LA4_5==AS||LA4_5==44) ) {
                    alt4=5;
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 4, 5, input);

                    throw nvae;
                }
                }
                break;
            case OPEN:
                {
                alt4=6;
                }
                break;
            case SURE:
                {
                alt4=7;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 4, 0, input);

                throw nvae;
            }

            switch (alt4) {
                case 1 :
                    // RiseCollectionFormula.g:26:4: ifStatement
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_ifStatement_in_statement65);
                    ifStatement3=ifStatement();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, ifStatement3.getTree());

                    }
                    break;
                case 2 :
                    // RiseCollectionFormula.g:27:4: FOR inListStatement ( statement )* ENDFOR
                    {
                    FOR4=(Token)match(input,FOR,FOLLOW_FOR_in_statement70); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_FOR.add(FOR4);

                    pushFollow(FOLLOW_inListStatement_in_statement72);
                    inListStatement5=inListStatement();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) stream_inListStatement.add(inListStatement5.getTree());
                    // RiseCollectionFormula.g:27:24: ( statement )*
                    loop2:
                    do {
                        int alt2=2;
                        int LA2_0 = input.LA(1);

                        if ( (LA2_0==FOR||LA2_0==FOREACH||LA2_0==IF||LA2_0==Identifier||LA2_0==OPEN||LA2_0==SURE||(LA2_0>=RANGECELL && LA2_0<=INDICATIONCELL)) ) {
                            alt2=1;
                        }


                        switch (alt2) {
                    	case 1 :
                    	    // RiseCollectionFormula.g:0:0: statement
                    	    {
                    	    pushFollow(FOLLOW_statement_in_statement74);
                    	    statement6=statement();

                    	    state._fsp--;
                    	    if (state.failed) return retval;
                    	    if ( state.backtracking==0 ) stream_statement.add(statement6.getTree());

                    	    }
                    	    break;

                    	default :
                    	    break loop2;
                        }
                    } while (true);

                    ENDFOR7=(Token)match(input,ENDFOR,FOLLOW_ENDFOR_in_statement77); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_ENDFOR.add(ENDFOR7);



                    // AST REWRITE
                    // elements: inListStatement, FOR, statement
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    if ( state.backtracking==0 ) {
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (Object)adaptor.nil();
                    // 28:3: -> ^( FOR inListStatement ( statement )* )
                    {
                        // RiseCollectionFormula.g:28:5: ^( FOR inListStatement ( statement )* )
                        {
                        Object root_1 = (Object)adaptor.nil();
                        root_1 = (Object)adaptor.becomeRoot(stream_FOR.nextNode(), root_1);

                        adaptor.addChild(root_1, stream_inListStatement.nextTree());
                        // RiseCollectionFormula.g:28:27: ( statement )*
                        while ( stream_statement.hasNext() ) {
                            adaptor.addChild(root_1, stream_statement.nextTree());

                        }
                        stream_statement.reset();

                        adaptor.addChild(root_0, root_1);
                        }

                    }

                    retval.tree = root_0;}
                    }
                    break;
                case 3 :
                    // RiseCollectionFormula.g:29:4: FOREACH ( statement )* ENDFOREACH
                    {
                    FOREACH8=(Token)match(input,FOREACH,FOLLOW_FOREACH_in_statement94); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_FOREACH.add(FOREACH8);

                    // RiseCollectionFormula.g:29:12: ( statement )*
                    loop3:
                    do {
                        int alt3=2;
                        int LA3_0 = input.LA(1);

                        if ( (LA3_0==FOR||LA3_0==FOREACH||LA3_0==IF||LA3_0==Identifier||LA3_0==OPEN||LA3_0==SURE||(LA3_0>=RANGECELL && LA3_0<=INDICATIONCELL)) ) {
                            alt3=1;
                        }


                        switch (alt3) {
                    	case 1 :
                    	    // RiseCollectionFormula.g:0:0: statement
                    	    {
                    	    pushFollow(FOLLOW_statement_in_statement96);
                    	    statement9=statement();

                    	    state._fsp--;
                    	    if (state.failed) return retval;
                    	    if ( state.backtracking==0 ) stream_statement.add(statement9.getTree());

                    	    }
                    	    break;

                    	default :
                    	    break loop3;
                        }
                    } while (true);

                    ENDFOREACH10=(Token)match(input,ENDFOREACH,FOLLOW_ENDFOREACH_in_statement99); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_ENDFOREACH.add(ENDFOREACH10);



                    // AST REWRITE
                    // elements: statement, FOREACH
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    if ( state.backtracking==0 ) {
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (Object)adaptor.nil();
                    // 30:3: -> ^( FOREACH ( statement )* )
                    {
                        // RiseCollectionFormula.g:30:5: ^( FOREACH ( statement )* )
                        {
                        Object root_1 = (Object)adaptor.nil();
                        root_1 = (Object)adaptor.becomeRoot(stream_FOREACH.nextNode(), root_1);

                        // RiseCollectionFormula.g:30:15: ( statement )*
                        while ( stream_statement.hasNext() ) {
                            adaptor.addChild(root_1, stream_statement.nextTree());

                        }
                        stream_statement.reset();

                        adaptor.addChild(root_0, root_1);
                        }

                    }

                    retval.tree = root_0;}
                    }
                    break;
                case 4 :
                    // RiseCollectionFormula.g:31:5: assignStatement
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_assignStatement_in_statement117);
                    assignStatement11=assignStatement();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, assignStatement11.getTree());

                    }
                    break;
                case 5 :
                    // RiseCollectionFormula.g:32:4: asAssignStatement
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_asAssignStatement_in_statement122);
                    asAssignStatement12=asAssignStatement();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, asAssignStatement12.getTree());

                    }
                    break;
                case 6 :
                    // RiseCollectionFormula.g:33:4: openStatement
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_openStatement_in_statement127);
                    openStatement13=openStatement();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, openStatement13.getTree());

                    }
                    break;
                case 7 :
                    // RiseCollectionFormula.g:34:4: functionStatement
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_functionStatement_in_statement132);
                    functionStatement14=functionStatement();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, functionStatement14.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "statement"

    public static class ifStatement_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "ifStatement"
    // RiseCollectionFormula.g:37:1: ifStatement : IF expression ( statement )* ( options {k=1; } : elseStatement )? ENDIF -> ^( IF expression ( statement )* ( elseStatement )? ) ;
    public final RiseCollectionFormulaParser.ifStatement_return ifStatement() throws RecognitionException {
        RiseCollectionFormulaParser.ifStatement_return retval = new RiseCollectionFormulaParser.ifStatement_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token IF15=null;
        Token ENDIF19=null;
        RiseCollectionFormulaParser.expression_return expression16 = null;

        RiseCollectionFormulaParser.statement_return statement17 = null;

        RiseCollectionFormulaParser.elseStatement_return elseStatement18 = null;


        Object IF15_tree=null;
        Object ENDIF19_tree=null;
        RewriteRuleTokenStream stream_ENDIF=new RewriteRuleTokenStream(adaptor,"token ENDIF");
        RewriteRuleTokenStream stream_IF=new RewriteRuleTokenStream(adaptor,"token IF");
        RewriteRuleSubtreeStream stream_elseStatement=new RewriteRuleSubtreeStream(adaptor,"rule elseStatement");
        RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
        RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
        try {
            // RiseCollectionFormula.g:38:2: ( IF expression ( statement )* ( options {k=1; } : elseStatement )? ENDIF -> ^( IF expression ( statement )* ( elseStatement )? ) )
            // RiseCollectionFormula.g:38:4: IF expression ( statement )* ( options {k=1; } : elseStatement )? ENDIF
            {
            IF15=(Token)match(input,IF,FOLLOW_IF_in_ifStatement144); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_IF.add(IF15);

            pushFollow(FOLLOW_expression_in_ifStatement146);
            expression16=expression();

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) stream_expression.add(expression16.getTree());
            // RiseCollectionFormula.g:38:18: ( statement )*
            loop5:
            do {
                int alt5=2;
                int LA5_0 = input.LA(1);

                if ( (LA5_0==FOR||LA5_0==FOREACH||LA5_0==IF||LA5_0==Identifier||LA5_0==OPEN||LA5_0==SURE||(LA5_0>=RANGECELL && LA5_0<=INDICATIONCELL)) ) {
                    alt5=1;
                }


                switch (alt5) {
            	case 1 :
            	    // RiseCollectionFormula.g:0:0: statement
            	    {
            	    pushFollow(FOLLOW_statement_in_ifStatement148);
            	    statement17=statement();

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) stream_statement.add(statement17.getTree());

            	    }
            	    break;

            	default :
            	    break loop5;
                }
            } while (true);

            // RiseCollectionFormula.g:38:29: ( options {k=1; } : elseStatement )?
            int alt6=2;
            int LA6_0 = input.LA(1);

            if ( (LA6_0==ELSE) ) {
                alt6=1;
            }
            switch (alt6) {
                case 1 :
                    // RiseCollectionFormula.g:38:46: elseStatement
                    {
                    pushFollow(FOLLOW_elseStatement_in_ifStatement160);
                    elseStatement18=elseStatement();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) stream_elseStatement.add(elseStatement18.getTree());

                    }
                    break;

            }

            ENDIF19=(Token)match(input,ENDIF,FOLLOW_ENDIF_in_ifStatement164); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_ENDIF.add(ENDIF19);



            // AST REWRITE
            // elements: expression, statement, elseStatement, IF
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            if ( state.backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 39:3: -> ^( IF expression ( statement )* ( elseStatement )? )
            {
                // RiseCollectionFormula.g:39:5: ^( IF expression ( statement )* ( elseStatement )? )
                {
                Object root_1 = (Object)adaptor.nil();
                root_1 = (Object)adaptor.becomeRoot(stream_IF.nextNode(), root_1);

                adaptor.addChild(root_1, stream_expression.nextTree());
                // RiseCollectionFormula.g:39:21: ( statement )*
                while ( stream_statement.hasNext() ) {
                    adaptor.addChild(root_1, stream_statement.nextTree());

                }
                stream_statement.reset();
                // RiseCollectionFormula.g:39:32: ( elseStatement )?
                if ( stream_elseStatement.hasNext() ) {
                    adaptor.addChild(root_1, stream_elseStatement.nextTree());

                }
                stream_elseStatement.reset();

                adaptor.addChild(root_0, root_1);
                }

            }

            retval.tree = root_0;}
            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "ifStatement"

    public static class elseStatement_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "elseStatement"
    // RiseCollectionFormula.g:42:1: elseStatement : ELSE ( statement )* -> ^( ELSE ( statement )* ) ;
    public final RiseCollectionFormulaParser.elseStatement_return elseStatement() throws RecognitionException {
        RiseCollectionFormulaParser.elseStatement_return retval = new RiseCollectionFormulaParser.elseStatement_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token ELSE20=null;
        RiseCollectionFormulaParser.statement_return statement21 = null;


        Object ELSE20_tree=null;
        RewriteRuleTokenStream stream_ELSE=new RewriteRuleTokenStream(adaptor,"token ELSE");
        RewriteRuleSubtreeStream stream_statement=new RewriteRuleSubtreeStream(adaptor,"rule statement");
        try {
            // RiseCollectionFormula.g:43:2: ( ELSE ( statement )* -> ^( ELSE ( statement )* ) )
            // RiseCollectionFormula.g:43:4: ELSE ( statement )*
            {
            ELSE20=(Token)match(input,ELSE,FOLLOW_ELSE_in_elseStatement191); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_ELSE.add(ELSE20);

            // RiseCollectionFormula.g:43:9: ( statement )*
            loop7:
            do {
                int alt7=2;
                int LA7_0 = input.LA(1);

                if ( (LA7_0==FOR||LA7_0==FOREACH||LA7_0==IF||LA7_0==Identifier||LA7_0==OPEN||LA7_0==SURE||(LA7_0>=RANGECELL && LA7_0<=INDICATIONCELL)) ) {
                    alt7=1;
                }


                switch (alt7) {
            	case 1 :
            	    // RiseCollectionFormula.g:0:0: statement
            	    {
            	    pushFollow(FOLLOW_statement_in_elseStatement193);
            	    statement21=statement();

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) stream_statement.add(statement21.getTree());

            	    }
            	    break;

            	default :
            	    break loop7;
                }
            } while (true);



            // AST REWRITE
            // elements: statement, ELSE
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            if ( state.backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 44:3: -> ^( ELSE ( statement )* )
            {
                // RiseCollectionFormula.g:44:5: ^( ELSE ( statement )* )
                {
                Object root_1 = (Object)adaptor.nil();
                root_1 = (Object)adaptor.becomeRoot(stream_ELSE.nextNode(), root_1);

                // RiseCollectionFormula.g:44:12: ( statement )*
                while ( stream_statement.hasNext() ) {
                    adaptor.addChild(root_1, stream_statement.nextTree());

                }
                stream_statement.reset();

                adaptor.addChild(root_0, root_1);
                }

            }

            retval.tree = root_0;}
            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "elseStatement"

    public static class assignStatement_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "assignStatement"
    // RiseCollectionFormula.g:47:1: assignStatement : ( assignkeywords '=' assignkeywords | assignkeywords '=' referenceassign -> ^( '=' assignkeywords referenceassign ) | reportkeywords '=' Identifier | reportkeywords '=' expression | Identifier '=' Identifier | Identifier '=' literal );
    public final RiseCollectionFormulaParser.assignStatement_return assignStatement() throws RecognitionException {
        RiseCollectionFormulaParser.assignStatement_return retval = new RiseCollectionFormulaParser.assignStatement_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token char_literal23=null;
        Token char_literal26=null;
        Token char_literal29=null;
        Token Identifier30=null;
        Token char_literal32=null;
        Token Identifier34=null;
        Token char_literal35=null;
        Token Identifier36=null;
        Token Identifier37=null;
        Token char_literal38=null;
        RiseCollectionFormulaParser.assignkeywords_return assignkeywords22 = null;

        RiseCollectionFormulaParser.assignkeywords_return assignkeywords24 = null;

        RiseCollectionFormulaParser.assignkeywords_return assignkeywords25 = null;

        RiseCollectionFormulaParser.referenceassign_return referenceassign27 = null;

        RiseCollectionFormulaParser.reportkeywords_return reportkeywords28 = null;

        RiseCollectionFormulaParser.reportkeywords_return reportkeywords31 = null;

        RiseCollectionFormulaParser.expression_return expression33 = null;

        RiseCollectionFormulaParser.literal_return literal39 = null;


        Object char_literal23_tree=null;
        Object char_literal26_tree=null;
        Object char_literal29_tree=null;
        Object Identifier30_tree=null;
        Object char_literal32_tree=null;
        Object Identifier34_tree=null;
        Object char_literal35_tree=null;
        Object Identifier36_tree=null;
        Object Identifier37_tree=null;
        Object char_literal38_tree=null;
        RewriteRuleTokenStream stream_43=new RewriteRuleTokenStream(adaptor,"token 43");
        RewriteRuleSubtreeStream stream_assignkeywords=new RewriteRuleSubtreeStream(adaptor,"rule assignkeywords");
        RewriteRuleSubtreeStream stream_referenceassign=new RewriteRuleSubtreeStream(adaptor,"rule referenceassign");
        try {
            // RiseCollectionFormula.g:48:2: ( assignkeywords '=' assignkeywords | assignkeywords '=' referenceassign -> ^( '=' assignkeywords referenceassign ) | reportkeywords '=' Identifier | reportkeywords '=' expression | Identifier '=' Identifier | Identifier '=' literal )
            int alt8=6;
            alt8 = dfa8.predict(input);
            switch (alt8) {
                case 1 :
                    // RiseCollectionFormula.g:48:4: assignkeywords '=' assignkeywords
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_assignkeywords_in_assignStatement216);
                    assignkeywords22=assignkeywords();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, assignkeywords22.getTree());
                    char_literal23=(Token)match(input,43,FOLLOW_43_in_assignStatement218); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    char_literal23_tree = (Object)adaptor.create(char_literal23);
                    adaptor.addChild(root_0, char_literal23_tree);
                    }
                    pushFollow(FOLLOW_assignkeywords_in_assignStatement220);
                    assignkeywords24=assignkeywords();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, assignkeywords24.getTree());

                    }
                    break;
                case 2 :
                    // RiseCollectionFormula.g:49:4: assignkeywords '=' referenceassign
                    {
                    pushFollow(FOLLOW_assignkeywords_in_assignStatement225);
                    assignkeywords25=assignkeywords();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) stream_assignkeywords.add(assignkeywords25.getTree());
                    char_literal26=(Token)match(input,43,FOLLOW_43_in_assignStatement227); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_43.add(char_literal26);

                    pushFollow(FOLLOW_referenceassign_in_assignStatement229);
                    referenceassign27=referenceassign();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) stream_referenceassign.add(referenceassign27.getTree());


                    // AST REWRITE
                    // elements: referenceassign, assignkeywords, 43
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    if ( state.backtracking==0 ) {
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (Object)adaptor.nil();
                    // 50:3: -> ^( '=' assignkeywords referenceassign )
                    {
                        // RiseCollectionFormula.g:50:5: ^( '=' assignkeywords referenceassign )
                        {
                        Object root_1 = (Object)adaptor.nil();
                        root_1 = (Object)adaptor.becomeRoot(stream_43.nextNode(), root_1);

                        adaptor.addChild(root_1, stream_assignkeywords.nextTree());
                        adaptor.addChild(root_1, stream_referenceassign.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }

                    retval.tree = root_0;}
                    }
                    break;
                case 3 :
                    // RiseCollectionFormula.g:51:4: reportkeywords '=' Identifier
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_reportkeywords_in_assignStatement245);
                    reportkeywords28=reportkeywords();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, reportkeywords28.getTree());
                    char_literal29=(Token)match(input,43,FOLLOW_43_in_assignStatement247); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    char_literal29_tree = (Object)adaptor.create(char_literal29);
                    adaptor.addChild(root_0, char_literal29_tree);
                    }
                    Identifier30=(Token)match(input,Identifier,FOLLOW_Identifier_in_assignStatement249); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    Identifier30_tree = (Object)adaptor.create(Identifier30);
                    adaptor.addChild(root_0, Identifier30_tree);
                    }

                    }
                    break;
                case 4 :
                    // RiseCollectionFormula.g:52:4: reportkeywords '=' expression
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_reportkeywords_in_assignStatement254);
                    reportkeywords31=reportkeywords();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, reportkeywords31.getTree());
                    char_literal32=(Token)match(input,43,FOLLOW_43_in_assignStatement256); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    char_literal32_tree = (Object)adaptor.create(char_literal32);
                    adaptor.addChild(root_0, char_literal32_tree);
                    }
                    pushFollow(FOLLOW_expression_in_assignStatement258);
                    expression33=expression();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, expression33.getTree());

                    }
                    break;
                case 5 :
                    // RiseCollectionFormula.g:53:4: Identifier '=' Identifier
                    {
                    root_0 = (Object)adaptor.nil();

                    Identifier34=(Token)match(input,Identifier,FOLLOW_Identifier_in_assignStatement263); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    Identifier34_tree = (Object)adaptor.create(Identifier34);
                    adaptor.addChild(root_0, Identifier34_tree);
                    }
                    char_literal35=(Token)match(input,43,FOLLOW_43_in_assignStatement265); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    char_literal35_tree = (Object)adaptor.create(char_literal35);
                    adaptor.addChild(root_0, char_literal35_tree);
                    }
                    Identifier36=(Token)match(input,Identifier,FOLLOW_Identifier_in_assignStatement267); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    Identifier36_tree = (Object)adaptor.create(Identifier36);
                    adaptor.addChild(root_0, Identifier36_tree);
                    }

                    }
                    break;
                case 6 :
                    // RiseCollectionFormula.g:54:4: Identifier '=' literal
                    {
                    root_0 = (Object)adaptor.nil();

                    Identifier37=(Token)match(input,Identifier,FOLLOW_Identifier_in_assignStatement272); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    Identifier37_tree = (Object)adaptor.create(Identifier37);
                    adaptor.addChild(root_0, Identifier37_tree);
                    }
                    char_literal38=(Token)match(input,43,FOLLOW_43_in_assignStatement274); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    char_literal38_tree = (Object)adaptor.create(char_literal38);
                    adaptor.addChild(root_0, char_literal38_tree);
                    }
                    pushFollow(FOLLOW_literal_in_assignStatement276);
                    literal39=literal();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, literal39.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "assignStatement"

    public static class asAssignStatement_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "asAssignStatement"
    // RiseCollectionFormula.g:57:1: asAssignStatement : ( Identifier AS Identifier -> ^( AS Identifier Identifier ) | Identifier '.' Identifier AS Identifier -> ^( AS Identifier Identifier Identifier ) );
    public final RiseCollectionFormulaParser.asAssignStatement_return asAssignStatement() throws RecognitionException {
        RiseCollectionFormulaParser.asAssignStatement_return retval = new RiseCollectionFormulaParser.asAssignStatement_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token Identifier40=null;
        Token AS41=null;
        Token Identifier42=null;
        Token Identifier43=null;
        Token char_literal44=null;
        Token Identifier45=null;
        Token AS46=null;
        Token Identifier47=null;

        Object Identifier40_tree=null;
        Object AS41_tree=null;
        Object Identifier42_tree=null;
        Object Identifier43_tree=null;
        Object char_literal44_tree=null;
        Object Identifier45_tree=null;
        Object AS46_tree=null;
        Object Identifier47_tree=null;
        RewriteRuleTokenStream stream_AS=new RewriteRuleTokenStream(adaptor,"token AS");
        RewriteRuleTokenStream stream_Identifier=new RewriteRuleTokenStream(adaptor,"token Identifier");
        RewriteRuleTokenStream stream_44=new RewriteRuleTokenStream(adaptor,"token 44");

        try {
            // RiseCollectionFormula.g:58:2: ( Identifier AS Identifier -> ^( AS Identifier Identifier ) | Identifier '.' Identifier AS Identifier -> ^( AS Identifier Identifier Identifier ) )
            int alt9=2;
            int LA9_0 = input.LA(1);

            if ( (LA9_0==Identifier) ) {
                int LA9_1 = input.LA(2);

                if ( (LA9_1==AS) ) {
                    alt9=1;
                }
                else if ( (LA9_1==44) ) {
                    alt9=2;
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 9, 1, input);

                    throw nvae;
                }
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 9, 0, input);

                throw nvae;
            }
            switch (alt9) {
                case 1 :
                    // RiseCollectionFormula.g:58:4: Identifier AS Identifier
                    {
                    Identifier40=(Token)match(input,Identifier,FOLLOW_Identifier_in_asAssignStatement288); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_Identifier.add(Identifier40);

                    AS41=(Token)match(input,AS,FOLLOW_AS_in_asAssignStatement290); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_AS.add(AS41);

                    Identifier42=(Token)match(input,Identifier,FOLLOW_Identifier_in_asAssignStatement292); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_Identifier.add(Identifier42);



                    // AST REWRITE
                    // elements: Identifier, AS, Identifier
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    if ( state.backtracking==0 ) {
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (Object)adaptor.nil();
                    // 59:3: -> ^( AS Identifier Identifier )
                    {
                        // RiseCollectionFormula.g:59:5: ^( AS Identifier Identifier )
                        {
                        Object root_1 = (Object)adaptor.nil();
                        root_1 = (Object)adaptor.becomeRoot(stream_AS.nextNode(), root_1);

                        adaptor.addChild(root_1, stream_Identifier.nextNode());
                        adaptor.addChild(root_1, stream_Identifier.nextNode());

                        adaptor.addChild(root_0, root_1);
                        }

                    }

                    retval.tree = root_0;}
                    }
                    break;
                case 2 :
                    // RiseCollectionFormula.g:60:4: Identifier '.' Identifier AS Identifier
                    {
                    Identifier43=(Token)match(input,Identifier,FOLLOW_Identifier_in_asAssignStatement308); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_Identifier.add(Identifier43);

                    char_literal44=(Token)match(input,44,FOLLOW_44_in_asAssignStatement310); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_44.add(char_literal44);

                    Identifier45=(Token)match(input,Identifier,FOLLOW_Identifier_in_asAssignStatement312); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_Identifier.add(Identifier45);

                    AS46=(Token)match(input,AS,FOLLOW_AS_in_asAssignStatement314); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_AS.add(AS46);

                    Identifier47=(Token)match(input,Identifier,FOLLOW_Identifier_in_asAssignStatement316); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_Identifier.add(Identifier47);



                    // AST REWRITE
                    // elements: Identifier, AS, Identifier, Identifier
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    if ( state.backtracking==0 ) {
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (Object)adaptor.nil();
                    // 61:3: -> ^( AS Identifier Identifier Identifier )
                    {
                        // RiseCollectionFormula.g:61:5: ^( AS Identifier Identifier Identifier )
                        {
                        Object root_1 = (Object)adaptor.nil();
                        root_1 = (Object)adaptor.becomeRoot(stream_AS.nextNode(), root_1);

                        adaptor.addChild(root_1, stream_Identifier.nextNode());
                        adaptor.addChild(root_1, stream_Identifier.nextNode());
                        adaptor.addChild(root_1, stream_Identifier.nextNode());

                        adaptor.addChild(root_0, root_1);
                        }

                    }

                    retval.tree = root_0;}
                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "asAssignStatement"

    public static class openStatement_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "openStatement"
    // RiseCollectionFormula.g:64:1: openStatement : ( OPEN Identifier '=' ( '-' DecimalLiteral | Identifier | Identifier '-' DecimalLiteral ) -> ^( OPEN Identifier ( Identifier )? ( DecimalLiteral )? ) | OPEN Identifier '=' LY '(' ( ')' | Identifier ')' | ')' '-' DecimalLiteral | Identifier ')' '-' DecimalLiteral ) -> ^( OPEN Identifier LY ( Identifier )? ( DecimalLiteral )? ) );
    public final RiseCollectionFormulaParser.openStatement_return openStatement() throws RecognitionException {
        RiseCollectionFormulaParser.openStatement_return retval = new RiseCollectionFormulaParser.openStatement_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token OPEN48=null;
        Token Identifier49=null;
        Token char_literal50=null;
        Token char_literal51=null;
        Token DecimalLiteral52=null;
        Token Identifier53=null;
        Token Identifier54=null;
        Token char_literal55=null;
        Token DecimalLiteral56=null;
        Token OPEN57=null;
        Token Identifier58=null;
        Token char_literal59=null;
        Token LY60=null;
        Token char_literal61=null;
        Token char_literal62=null;
        Token Identifier63=null;
        Token char_literal64=null;
        Token char_literal65=null;
        Token char_literal66=null;
        Token DecimalLiteral67=null;
        Token Identifier68=null;
        Token char_literal69=null;
        Token char_literal70=null;
        Token DecimalLiteral71=null;

        Object OPEN48_tree=null;
        Object Identifier49_tree=null;
        Object char_literal50_tree=null;
        Object char_literal51_tree=null;
        Object DecimalLiteral52_tree=null;
        Object Identifier53_tree=null;
        Object Identifier54_tree=null;
        Object char_literal55_tree=null;
        Object DecimalLiteral56_tree=null;
        Object OPEN57_tree=null;
        Object Identifier58_tree=null;
        Object char_literal59_tree=null;
        Object LY60_tree=null;
        Object char_literal61_tree=null;
        Object char_literal62_tree=null;
        Object Identifier63_tree=null;
        Object char_literal64_tree=null;
        Object char_literal65_tree=null;
        Object char_literal66_tree=null;
        Object DecimalLiteral67_tree=null;
        Object Identifier68_tree=null;
        Object char_literal69_tree=null;
        Object char_literal70_tree=null;
        Object DecimalLiteral71_tree=null;
        RewriteRuleTokenStream stream_43=new RewriteRuleTokenStream(adaptor,"token 43");
        RewriteRuleTokenStream stream_LY=new RewriteRuleTokenStream(adaptor,"token LY");
        RewriteRuleTokenStream stream_46=new RewriteRuleTokenStream(adaptor,"token 46");
        RewriteRuleTokenStream stream_Identifier=new RewriteRuleTokenStream(adaptor,"token Identifier");
        RewriteRuleTokenStream stream_OPEN=new RewriteRuleTokenStream(adaptor,"token OPEN");
        RewriteRuleTokenStream stream_47=new RewriteRuleTokenStream(adaptor,"token 47");
        RewriteRuleTokenStream stream_DecimalLiteral=new RewriteRuleTokenStream(adaptor,"token DecimalLiteral");
        RewriteRuleTokenStream stream_45=new RewriteRuleTokenStream(adaptor,"token 45");

        try {
            // RiseCollectionFormula.g:65:2: ( OPEN Identifier '=' ( '-' DecimalLiteral | Identifier | Identifier '-' DecimalLiteral ) -> ^( OPEN Identifier ( Identifier )? ( DecimalLiteral )? ) | OPEN Identifier '=' LY '(' ( ')' | Identifier ')' | ')' '-' DecimalLiteral | Identifier ')' '-' DecimalLiteral ) -> ^( OPEN Identifier LY ( Identifier )? ( DecimalLiteral )? ) )
            int alt12=2;
            int LA12_0 = input.LA(1);

            if ( (LA12_0==OPEN) ) {
                int LA12_1 = input.LA(2);

                if ( (LA12_1==Identifier) ) {
                    int LA12_2 = input.LA(3);

                    if ( (LA12_2==43) ) {
                        int LA12_3 = input.LA(4);

                        if ( (LA12_3==LY) ) {
                            alt12=2;
                        }
                        else if ( (LA12_3==Identifier||LA12_3==45) ) {
                            alt12=1;
                        }
                        else {
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 12, 3, input);

                            throw nvae;
                        }
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 12, 2, input);

                        throw nvae;
                    }
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 12, 1, input);

                    throw nvae;
                }
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 12, 0, input);

                throw nvae;
            }
            switch (alt12) {
                case 1 :
                    // RiseCollectionFormula.g:65:4: OPEN Identifier '=' ( '-' DecimalLiteral | Identifier | Identifier '-' DecimalLiteral )
                    {
                    OPEN48=(Token)match(input,OPEN,FOLLOW_OPEN_in_openStatement341); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_OPEN.add(OPEN48);

                    Identifier49=(Token)match(input,Identifier,FOLLOW_Identifier_in_openStatement343); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_Identifier.add(Identifier49);

                    char_literal50=(Token)match(input,43,FOLLOW_43_in_openStatement345); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_43.add(char_literal50);

                    // RiseCollectionFormula.g:65:24: ( '-' DecimalLiteral | Identifier | Identifier '-' DecimalLiteral )
                    int alt10=3;
                    int LA10_0 = input.LA(1);

                    if ( (LA10_0==45) ) {
                        alt10=1;
                    }
                    else if ( (LA10_0==Identifier) ) {
                        int LA10_2 = input.LA(2);

                        if ( (LA10_2==45) ) {
                            alt10=3;
                        }
                        else if ( (LA10_2==EOF||(LA10_2>=FOR && LA10_2<=Identifier)||LA10_2==OPEN||LA10_2==SURE||(LA10_2>=RANGECELL && LA10_2<=INDICATIONCELL)) ) {
                            alt10=2;
                        }
                        else {
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 10, 2, input);

                            throw nvae;
                        }
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 10, 0, input);

                        throw nvae;
                    }
                    switch (alt10) {
                        case 1 :
                            // RiseCollectionFormula.g:65:25: '-' DecimalLiteral
                            {
                            char_literal51=(Token)match(input,45,FOLLOW_45_in_openStatement348); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_45.add(char_literal51);

                            DecimalLiteral52=(Token)match(input,DecimalLiteral,FOLLOW_DecimalLiteral_in_openStatement350); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_DecimalLiteral.add(DecimalLiteral52);


                            }
                            break;
                        case 2 :
                            // RiseCollectionFormula.g:66:6: Identifier
                            {
                            Identifier53=(Token)match(input,Identifier,FOLLOW_Identifier_in_openStatement357); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_Identifier.add(Identifier53);


                            }
                            break;
                        case 3 :
                            // RiseCollectionFormula.g:67:6: Identifier '-' DecimalLiteral
                            {
                            Identifier54=(Token)match(input,Identifier,FOLLOW_Identifier_in_openStatement364); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_Identifier.add(Identifier54);

                            char_literal55=(Token)match(input,45,FOLLOW_45_in_openStatement366); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_45.add(char_literal55);

                            DecimalLiteral56=(Token)match(input,DecimalLiteral,FOLLOW_DecimalLiteral_in_openStatement368); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_DecimalLiteral.add(DecimalLiteral56);


                            }
                            break;

                    }



                    // AST REWRITE
                    // elements: Identifier, Identifier, DecimalLiteral, OPEN
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    if ( state.backtracking==0 ) {
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (Object)adaptor.nil();
                    // 68:3: -> ^( OPEN Identifier ( Identifier )? ( DecimalLiteral )? )
                    {
                        // RiseCollectionFormula.g:68:5: ^( OPEN Identifier ( Identifier )? ( DecimalLiteral )? )
                        {
                        Object root_1 = (Object)adaptor.nil();
                        root_1 = (Object)adaptor.becomeRoot(stream_OPEN.nextNode(), root_1);

                        adaptor.addChild(root_1, stream_Identifier.nextNode());
                        // RiseCollectionFormula.g:68:23: ( Identifier )?
                        if ( stream_Identifier.hasNext() ) {
                            adaptor.addChild(root_1, stream_Identifier.nextNode());

                        }
                        stream_Identifier.reset();
                        // RiseCollectionFormula.g:68:35: ( DecimalLiteral )?
                        if ( stream_DecimalLiteral.hasNext() ) {
                            adaptor.addChild(root_1, stream_DecimalLiteral.nextNode());

                        }
                        stream_DecimalLiteral.reset();

                        adaptor.addChild(root_0, root_1);
                        }

                    }

                    retval.tree = root_0;}
                    }
                    break;
                case 2 :
                    // RiseCollectionFormula.g:69:4: OPEN Identifier '=' LY '(' ( ')' | Identifier ')' | ')' '-' DecimalLiteral | Identifier ')' '-' DecimalLiteral )
                    {
                    OPEN57=(Token)match(input,OPEN,FOLLOW_OPEN_in_openStatement389); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_OPEN.add(OPEN57);

                    Identifier58=(Token)match(input,Identifier,FOLLOW_Identifier_in_openStatement391); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_Identifier.add(Identifier58);

                    char_literal59=(Token)match(input,43,FOLLOW_43_in_openStatement393); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_43.add(char_literal59);

                    LY60=(Token)match(input,LY,FOLLOW_LY_in_openStatement395); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_LY.add(LY60);

                    char_literal61=(Token)match(input,46,FOLLOW_46_in_openStatement397); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_46.add(char_literal61);

                    // RiseCollectionFormula.g:69:31: ( ')' | Identifier ')' | ')' '-' DecimalLiteral | Identifier ')' '-' DecimalLiteral )
                    int alt11=4;
                    int LA11_0 = input.LA(1);

                    if ( (LA11_0==47) ) {
                        int LA11_1 = input.LA(2);

                        if ( (LA11_1==45) ) {
                            alt11=3;
                        }
                        else if ( (LA11_1==EOF||(LA11_1>=FOR && LA11_1<=Identifier)||LA11_1==OPEN||LA11_1==SURE||(LA11_1>=RANGECELL && LA11_1<=INDICATIONCELL)) ) {
                            alt11=1;
                        }
                        else {
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 11, 1, input);

                            throw nvae;
                        }
                    }
                    else if ( (LA11_0==Identifier) ) {
                        int LA11_2 = input.LA(2);

                        if ( (LA11_2==47) ) {
                            int LA11_5 = input.LA(3);

                            if ( (LA11_5==45) ) {
                                alt11=4;
                            }
                            else if ( (LA11_5==EOF||(LA11_5>=FOR && LA11_5<=Identifier)||LA11_5==OPEN||LA11_5==SURE||(LA11_5>=RANGECELL && LA11_5<=INDICATIONCELL)) ) {
                                alt11=2;
                            }
                            else {
                                if (state.backtracking>0) {state.failed=true; return retval;}
                                NoViableAltException nvae =
                                    new NoViableAltException("", 11, 5, input);

                                throw nvae;
                            }
                        }
                        else {
                            if (state.backtracking>0) {state.failed=true; return retval;}
                            NoViableAltException nvae =
                                new NoViableAltException("", 11, 2, input);

                            throw nvae;
                        }
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 11, 0, input);

                        throw nvae;
                    }
                    switch (alt11) {
                        case 1 :
                            // RiseCollectionFormula.g:69:33: ')'
                            {
                            char_literal62=(Token)match(input,47,FOLLOW_47_in_openStatement401); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_47.add(char_literal62);


                            }
                            break;
                        case 2 :
                            // RiseCollectionFormula.g:70:6: Identifier ')'
                            {
                            Identifier63=(Token)match(input,Identifier,FOLLOW_Identifier_in_openStatement408); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_Identifier.add(Identifier63);

                            char_literal64=(Token)match(input,47,FOLLOW_47_in_openStatement410); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_47.add(char_literal64);


                            }
                            break;
                        case 3 :
                            // RiseCollectionFormula.g:71:6: ')' '-' DecimalLiteral
                            {
                            char_literal65=(Token)match(input,47,FOLLOW_47_in_openStatement417); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_47.add(char_literal65);

                            char_literal66=(Token)match(input,45,FOLLOW_45_in_openStatement419); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_45.add(char_literal66);

                            DecimalLiteral67=(Token)match(input,DecimalLiteral,FOLLOW_DecimalLiteral_in_openStatement421); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_DecimalLiteral.add(DecimalLiteral67);


                            }
                            break;
                        case 4 :
                            // RiseCollectionFormula.g:72:6: Identifier ')' '-' DecimalLiteral
                            {
                            Identifier68=(Token)match(input,Identifier,FOLLOW_Identifier_in_openStatement428); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_Identifier.add(Identifier68);

                            char_literal69=(Token)match(input,47,FOLLOW_47_in_openStatement430); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_47.add(char_literal69);

                            char_literal70=(Token)match(input,45,FOLLOW_45_in_openStatement432); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_45.add(char_literal70);

                            DecimalLiteral71=(Token)match(input,DecimalLiteral,FOLLOW_DecimalLiteral_in_openStatement434); if (state.failed) return retval; 
                            if ( state.backtracking==0 ) stream_DecimalLiteral.add(DecimalLiteral71);


                            }
                            break;

                    }



                    // AST REWRITE
                    // elements: Identifier, OPEN, LY, Identifier, DecimalLiteral
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    if ( state.backtracking==0 ) {
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (Object)adaptor.nil();
                    // 73:3: -> ^( OPEN Identifier LY ( Identifier )? ( DecimalLiteral )? )
                    {
                        // RiseCollectionFormula.g:73:5: ^( OPEN Identifier LY ( Identifier )? ( DecimalLiteral )? )
                        {
                        Object root_1 = (Object)adaptor.nil();
                        root_1 = (Object)adaptor.becomeRoot(stream_OPEN.nextNode(), root_1);

                        adaptor.addChild(root_1, stream_Identifier.nextNode());
                        adaptor.addChild(root_1, stream_LY.nextNode());
                        // RiseCollectionFormula.g:73:26: ( Identifier )?
                        if ( stream_Identifier.hasNext() ) {
                            adaptor.addChild(root_1, stream_Identifier.nextNode());

                        }
                        stream_Identifier.reset();
                        // RiseCollectionFormula.g:73:38: ( DecimalLiteral )?
                        if ( stream_DecimalLiteral.hasNext() ) {
                            adaptor.addChild(root_1, stream_DecimalLiteral.nextNode());

                        }
                        stream_DecimalLiteral.reset();

                        adaptor.addChild(root_0, root_1);
                        }

                    }

                    retval.tree = root_0;}
                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "openStatement"

    public static class functionStatement_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "functionStatement"
    // RiseCollectionFormula.g:76:1: functionStatement : SURE '(' expression ( ',' expression )* ',' StringLiteral ')' -> ( ^( SURE expression StringLiteral ) )+ ;
    public final RiseCollectionFormulaParser.functionStatement_return functionStatement() throws RecognitionException {
        RiseCollectionFormulaParser.functionStatement_return retval = new RiseCollectionFormulaParser.functionStatement_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token SURE72=null;
        Token char_literal73=null;
        Token char_literal75=null;
        Token char_literal77=null;
        Token StringLiteral78=null;
        Token char_literal79=null;
        RiseCollectionFormulaParser.expression_return expression74 = null;

        RiseCollectionFormulaParser.expression_return expression76 = null;


        Object SURE72_tree=null;
        Object char_literal73_tree=null;
        Object char_literal75_tree=null;
        Object char_literal77_tree=null;
        Object StringLiteral78_tree=null;
        Object char_literal79_tree=null;
        RewriteRuleTokenStream stream_48=new RewriteRuleTokenStream(adaptor,"token 48");
        RewriteRuleTokenStream stream_StringLiteral=new RewriteRuleTokenStream(adaptor,"token StringLiteral");
        RewriteRuleTokenStream stream_46=new RewriteRuleTokenStream(adaptor,"token 46");
        RewriteRuleTokenStream stream_47=new RewriteRuleTokenStream(adaptor,"token 47");
        RewriteRuleTokenStream stream_SURE=new RewriteRuleTokenStream(adaptor,"token SURE");
        RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
        try {
            // RiseCollectionFormula.g:77:2: ( SURE '(' expression ( ',' expression )* ',' StringLiteral ')' -> ( ^( SURE expression StringLiteral ) )+ )
            // RiseCollectionFormula.g:77:4: SURE '(' expression ( ',' expression )* ',' StringLiteral ')'
            {
            SURE72=(Token)match(input,SURE,FOLLOW_SURE_in_functionStatement464); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_SURE.add(SURE72);

            char_literal73=(Token)match(input,46,FOLLOW_46_in_functionStatement465); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_46.add(char_literal73);

            pushFollow(FOLLOW_expression_in_functionStatement466);
            expression74=expression();

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) stream_expression.add(expression74.getTree());
            // RiseCollectionFormula.g:77:22: ( ',' expression )*
            loop13:
            do {
                int alt13=2;
                int LA13_0 = input.LA(1);

                if ( (LA13_0==48) ) {
                    int LA13_1 = input.LA(2);

                    if ( (LA13_1==StringLiteral) ) {
                        int LA13_2 = input.LA(3);

                        if ( (LA13_2==Identifier||LA13_2==DecimalLiteral||LA13_2==StringLiteral||(LA13_2>=RANGECELL && LA13_2<=ABS)||(LA13_2>=FloatingPointLiteral && LA13_2<=CharacterLiteral)||(LA13_2>=45 && LA13_2<=46)||LA13_2==48||(LA13_2>=51 && LA13_2<=63)||(LA13_2>=65 && LA13_2<=67)) ) {
                            alt13=1;
                        }


                    }
                    else if ( (LA13_1==Identifier||LA13_1==DecimalLiteral||(LA13_1>=RANGECELL && LA13_1<=ABS)||(LA13_1>=FloatingPointLiteral && LA13_1<=CharacterLiteral)||(LA13_1>=45 && LA13_1<=46)||LA13_1==60||(LA13_1>=65 && LA13_1<=67)) ) {
                        alt13=1;
                    }


                }


                switch (alt13) {
            	case 1 :
            	    // RiseCollectionFormula.g:77:23: ',' expression
            	    {
            	    char_literal75=(Token)match(input,48,FOLLOW_48_in_functionStatement469); if (state.failed) return retval; 
            	    if ( state.backtracking==0 ) stream_48.add(char_literal75);

            	    pushFollow(FOLLOW_expression_in_functionStatement471);
            	    expression76=expression();

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) stream_expression.add(expression76.getTree());

            	    }
            	    break;

            	default :
            	    break loop13;
                }
            } while (true);

            char_literal77=(Token)match(input,48,FOLLOW_48_in_functionStatement475); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_48.add(char_literal77);

            StringLiteral78=(Token)match(input,StringLiteral,FOLLOW_StringLiteral_in_functionStatement477); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_StringLiteral.add(StringLiteral78);

            char_literal79=(Token)match(input,47,FOLLOW_47_in_functionStatement478); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_47.add(char_literal79);



            // AST REWRITE
            // elements: expression, SURE, StringLiteral
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            if ( state.backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 78:3: -> ( ^( SURE expression StringLiteral ) )+
            {
                if ( !(stream_expression.hasNext()||stream_SURE.hasNext()||stream_StringLiteral.hasNext()) ) {
                    throw new RewriteEarlyExitException();
                }
                while ( stream_expression.hasNext()||stream_SURE.hasNext()||stream_StringLiteral.hasNext() ) {
                    // RiseCollectionFormula.g:78:5: ^( SURE expression StringLiteral )
                    {
                    Object root_1 = (Object)adaptor.nil();
                    root_1 = (Object)adaptor.becomeRoot(stream_SURE.nextNode(), root_1);

                    adaptor.addChild(root_1, stream_expression.nextTree());
                    adaptor.addChild(root_1, stream_StringLiteral.nextNode());

                    adaptor.addChild(root_0, root_1);
                    }

                }
                stream_expression.reset();
                stream_SURE.reset();
                stream_StringLiteral.reset();

            }

            retval.tree = root_0;}
            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "functionStatement"

    public static class inListStatement_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "inListStatement"
    // RiseCollectionFormula.g:81:1: inListStatement : Identifier IN forInScope ( DecimalLiteral )? -> ^( IN Identifier forInScope ( DecimalLiteral )? ) ;
    public final RiseCollectionFormulaParser.inListStatement_return inListStatement() throws RecognitionException {
        RiseCollectionFormulaParser.inListStatement_return retval = new RiseCollectionFormulaParser.inListStatement_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token Identifier80=null;
        Token IN81=null;
        Token DecimalLiteral83=null;
        RiseCollectionFormulaParser.forInScope_return forInScope82 = null;


        Object Identifier80_tree=null;
        Object IN81_tree=null;
        Object DecimalLiteral83_tree=null;
        RewriteRuleTokenStream stream_Identifier=new RewriteRuleTokenStream(adaptor,"token Identifier");
        RewriteRuleTokenStream stream_DecimalLiteral=new RewriteRuleTokenStream(adaptor,"token DecimalLiteral");
        RewriteRuleTokenStream stream_IN=new RewriteRuleTokenStream(adaptor,"token IN");
        RewriteRuleSubtreeStream stream_forInScope=new RewriteRuleSubtreeStream(adaptor,"rule forInScope");
        try {
            // RiseCollectionFormula.g:82:2: ( Identifier IN forInScope ( DecimalLiteral )? -> ^( IN Identifier forInScope ( DecimalLiteral )? ) )
            // RiseCollectionFormula.g:82:4: Identifier IN forInScope ( DecimalLiteral )?
            {
            Identifier80=(Token)match(input,Identifier,FOLLOW_Identifier_in_inListStatement502); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_Identifier.add(Identifier80);

            IN81=(Token)match(input,IN,FOLLOW_IN_in_inListStatement504); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_IN.add(IN81);

            pushFollow(FOLLOW_forInScope_in_inListStatement506);
            forInScope82=forInScope();

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) stream_forInScope.add(forInScope82.getTree());
            // RiseCollectionFormula.g:82:29: ( DecimalLiteral )?
            int alt14=2;
            int LA14_0 = input.LA(1);

            if ( (LA14_0==DecimalLiteral) ) {
                alt14=1;
            }
            switch (alt14) {
                case 1 :
                    // RiseCollectionFormula.g:0:0: DecimalLiteral
                    {
                    DecimalLiteral83=(Token)match(input,DecimalLiteral,FOLLOW_DecimalLiteral_in_inListStatement508); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_DecimalLiteral.add(DecimalLiteral83);


                    }
                    break;

            }



            // AST REWRITE
            // elements: forInScope, DecimalLiteral, Identifier, IN
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            if ( state.backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 83:3: -> ^( IN Identifier forInScope ( DecimalLiteral )? )
            {
                // RiseCollectionFormula.g:83:5: ^( IN Identifier forInScope ( DecimalLiteral )? )
                {
                Object root_1 = (Object)adaptor.nil();
                root_1 = (Object)adaptor.becomeRoot(stream_IN.nextNode(), root_1);

                adaptor.addChild(root_1, stream_Identifier.nextNode());
                adaptor.addChild(root_1, stream_forInScope.nextTree());
                // RiseCollectionFormula.g:83:32: ( DecimalLiteral )?
                if ( stream_DecimalLiteral.hasNext() ) {
                    adaptor.addChild(root_1, stream_DecimalLiteral.nextNode());

                }
                stream_DecimalLiteral.reset();

                adaptor.addChild(root_0, root_1);
                }

            }

            retval.tree = root_0;}
            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "inListStatement"

    public static class forInScope_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "forInScope"
    // RiseCollectionFormula.g:86:1: forInScope : ( scopeDigital | listDigital );
    public final RiseCollectionFormulaParser.forInScope_return forInScope() throws RecognitionException {
        RiseCollectionFormulaParser.forInScope_return retval = new RiseCollectionFormulaParser.forInScope_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        RiseCollectionFormulaParser.scopeDigital_return scopeDigital84 = null;

        RiseCollectionFormulaParser.listDigital_return listDigital85 = null;



        try {
            // RiseCollectionFormula.g:87:2: ( scopeDigital | listDigital )
            int alt15=2;
            int LA15_0 = input.LA(1);

            if ( (LA15_0==49) ) {
                int LA15_1 = input.LA(2);

                if ( (LA15_1==DecimalLiteral) ) {
                    int LA15_2 = input.LA(3);

                    if ( (LA15_2==TO) ) {
                        alt15=1;
                    }
                    else if ( (LA15_2==48||LA15_2==50) ) {
                        alt15=2;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 15, 2, input);

                        throw nvae;
                    }
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 15, 1, input);

                    throw nvae;
                }
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 15, 0, input);

                throw nvae;
            }
            switch (alt15) {
                case 1 :
                    // RiseCollectionFormula.g:87:4: scopeDigital
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_scopeDigital_in_forInScope536);
                    scopeDigital84=scopeDigital();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, scopeDigital84.getTree());

                    }
                    break;
                case 2 :
                    // RiseCollectionFormula.g:87:17: listDigital
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_listDigital_in_forInScope538);
                    listDigital85=listDigital();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, listDigital85.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "forInScope"

    public static class scopeDigital_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "scopeDigital"
    // RiseCollectionFormula.g:90:1: scopeDigital : '[' DecimalLiteral TO DecimalLiteral ']' -> ^( TO DecimalLiteral DecimalLiteral ) ;
    public final RiseCollectionFormulaParser.scopeDigital_return scopeDigital() throws RecognitionException {
        RiseCollectionFormulaParser.scopeDigital_return retval = new RiseCollectionFormulaParser.scopeDigital_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token char_literal86=null;
        Token DecimalLiteral87=null;
        Token TO88=null;
        Token DecimalLiteral89=null;
        Token char_literal90=null;

        Object char_literal86_tree=null;
        Object DecimalLiteral87_tree=null;
        Object TO88_tree=null;
        Object DecimalLiteral89_tree=null;
        Object char_literal90_tree=null;
        RewriteRuleTokenStream stream_TO=new RewriteRuleTokenStream(adaptor,"token TO");
        RewriteRuleTokenStream stream_50=new RewriteRuleTokenStream(adaptor,"token 50");
        RewriteRuleTokenStream stream_DecimalLiteral=new RewriteRuleTokenStream(adaptor,"token DecimalLiteral");
        RewriteRuleTokenStream stream_49=new RewriteRuleTokenStream(adaptor,"token 49");

        try {
            // RiseCollectionFormula.g:91:2: ( '[' DecimalLiteral TO DecimalLiteral ']' -> ^( TO DecimalLiteral DecimalLiteral ) )
            // RiseCollectionFormula.g:91:4: '[' DecimalLiteral TO DecimalLiteral ']'
            {
            char_literal86=(Token)match(input,49,FOLLOW_49_in_scopeDigital550); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_49.add(char_literal86);

            DecimalLiteral87=(Token)match(input,DecimalLiteral,FOLLOW_DecimalLiteral_in_scopeDigital551); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_DecimalLiteral.add(DecimalLiteral87);

            TO88=(Token)match(input,TO,FOLLOW_TO_in_scopeDigital553); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_TO.add(TO88);

            DecimalLiteral89=(Token)match(input,DecimalLiteral,FOLLOW_DecimalLiteral_in_scopeDigital555); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_DecimalLiteral.add(DecimalLiteral89);

            char_literal90=(Token)match(input,50,FOLLOW_50_in_scopeDigital556); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_50.add(char_literal90);



            // AST REWRITE
            // elements: DecimalLiteral, TO, DecimalLiteral
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            if ( state.backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 92:3: -> ^( TO DecimalLiteral DecimalLiteral )
            {
                // RiseCollectionFormula.g:92:5: ^( TO DecimalLiteral DecimalLiteral )
                {
                Object root_1 = (Object)adaptor.nil();
                root_1 = (Object)adaptor.becomeRoot(stream_TO.nextNode(), root_1);

                adaptor.addChild(root_1, stream_DecimalLiteral.nextNode());
                adaptor.addChild(root_1, stream_DecimalLiteral.nextNode());

                adaptor.addChild(root_0, root_1);
                }

            }

            retval.tree = root_0;}
            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "scopeDigital"

    public static class listDigital_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "listDigital"
    // RiseCollectionFormula.g:95:1: listDigital : '[' DecimalLiteral ( ',' DecimalLiteral )* ']' -> ^( DECINODE ( DecimalLiteral )+ ) ;
    public final RiseCollectionFormulaParser.listDigital_return listDigital() throws RecognitionException {
        RiseCollectionFormulaParser.listDigital_return retval = new RiseCollectionFormulaParser.listDigital_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token char_literal91=null;
        Token DecimalLiteral92=null;
        Token char_literal93=null;
        Token DecimalLiteral94=null;
        Token char_literal95=null;

        Object char_literal91_tree=null;
        Object DecimalLiteral92_tree=null;
        Object char_literal93_tree=null;
        Object DecimalLiteral94_tree=null;
        Object char_literal95_tree=null;
        RewriteRuleTokenStream stream_48=new RewriteRuleTokenStream(adaptor,"token 48");
        RewriteRuleTokenStream stream_50=new RewriteRuleTokenStream(adaptor,"token 50");
        RewriteRuleTokenStream stream_DecimalLiteral=new RewriteRuleTokenStream(adaptor,"token DecimalLiteral");
        RewriteRuleTokenStream stream_49=new RewriteRuleTokenStream(adaptor,"token 49");

        try {
            // RiseCollectionFormula.g:96:2: ( '[' DecimalLiteral ( ',' DecimalLiteral )* ']' -> ^( DECINODE ( DecimalLiteral )+ ) )
            // RiseCollectionFormula.g:96:4: '[' DecimalLiteral ( ',' DecimalLiteral )* ']'
            {
            char_literal91=(Token)match(input,49,FOLLOW_49_in_listDigital579); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_49.add(char_literal91);

            DecimalLiteral92=(Token)match(input,DecimalLiteral,FOLLOW_DecimalLiteral_in_listDigital580); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_DecimalLiteral.add(DecimalLiteral92);

            // RiseCollectionFormula.g:96:21: ( ',' DecimalLiteral )*
            loop16:
            do {
                int alt16=2;
                int LA16_0 = input.LA(1);

                if ( (LA16_0==48) ) {
                    alt16=1;
                }


                switch (alt16) {
            	case 1 :
            	    // RiseCollectionFormula.g:96:22: ',' DecimalLiteral
            	    {
            	    char_literal93=(Token)match(input,48,FOLLOW_48_in_listDigital582); if (state.failed) return retval; 
            	    if ( state.backtracking==0 ) stream_48.add(char_literal93);

            	    DecimalLiteral94=(Token)match(input,DecimalLiteral,FOLLOW_DecimalLiteral_in_listDigital583); if (state.failed) return retval; 
            	    if ( state.backtracking==0 ) stream_DecimalLiteral.add(DecimalLiteral94);


            	    }
            	    break;

            	default :
            	    break loop16;
                }
            } while (true);

            char_literal95=(Token)match(input,50,FOLLOW_50_in_listDigital586); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_50.add(char_literal95);



            // AST REWRITE
            // elements: DecimalLiteral
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            if ( state.backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 97:3: -> ^( DECINODE ( DecimalLiteral )+ )
            {
                // RiseCollectionFormula.g:97:5: ^( DECINODE ( DecimalLiteral )+ )
                {
                Object root_1 = (Object)adaptor.nil();
                root_1 = (Object)adaptor.becomeRoot((Object)adaptor.create(DECINODE, "DECINODE"), root_1);

                if ( !(stream_DecimalLiteral.hasNext()) ) {
                    throw new RewriteEarlyExitException();
                }
                while ( stream_DecimalLiteral.hasNext() ) {
                    adaptor.addChild(root_1, stream_DecimalLiteral.nextNode());

                }
                stream_DecimalLiteral.reset();

                adaptor.addChild(root_0, root_1);
                }

            }

            retval.tree = root_0;}
            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "listDigital"

    public static class expression_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "expression"
    // RiseCollectionFormula.g:100:1: expression : conditionalOrExpression ;
    public final RiseCollectionFormulaParser.expression_return expression() throws RecognitionException {
        RiseCollectionFormulaParser.expression_return retval = new RiseCollectionFormulaParser.expression_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        RiseCollectionFormulaParser.conditionalOrExpression_return conditionalOrExpression96 = null;



        try {
            // RiseCollectionFormula.g:101:2: ( conditionalOrExpression )
            // RiseCollectionFormula.g:101:4: conditionalOrExpression
            {
            root_0 = (Object)adaptor.nil();

            pushFollow(FOLLOW_conditionalOrExpression_in_expression608);
            conditionalOrExpression96=conditionalOrExpression();

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) adaptor.addChild(root_0, conditionalOrExpression96.getTree());

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "expression"

    public static class conditionalOrExpression_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "conditionalOrExpression"
    // RiseCollectionFormula.g:104:1: conditionalOrExpression : conditionalAndExpression ( '||' conditionalAndExpression )* ;
    public final RiseCollectionFormulaParser.conditionalOrExpression_return conditionalOrExpression() throws RecognitionException {
        RiseCollectionFormulaParser.conditionalOrExpression_return retval = new RiseCollectionFormulaParser.conditionalOrExpression_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token string_literal98=null;
        RiseCollectionFormulaParser.conditionalAndExpression_return conditionalAndExpression97 = null;

        RiseCollectionFormulaParser.conditionalAndExpression_return conditionalAndExpression99 = null;


        Object string_literal98_tree=null;

        try {
            // RiseCollectionFormula.g:105:6: ( conditionalAndExpression ( '||' conditionalAndExpression )* )
            // RiseCollectionFormula.g:105:10: conditionalAndExpression ( '||' conditionalAndExpression )*
            {
            root_0 = (Object)adaptor.nil();

            pushFollow(FOLLOW_conditionalAndExpression_in_conditionalOrExpression625);
            conditionalAndExpression97=conditionalAndExpression();

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) adaptor.addChild(root_0, conditionalAndExpression97.getTree());
            // RiseCollectionFormula.g:105:35: ( '||' conditionalAndExpression )*
            loop17:
            do {
                int alt17=2;
                int LA17_0 = input.LA(1);

                if ( (LA17_0==51) ) {
                    alt17=1;
                }


                switch (alt17) {
            	case 1 :
            	    // RiseCollectionFormula.g:105:37: '||' conditionalAndExpression
            	    {
            	    string_literal98=(Token)match(input,51,FOLLOW_51_in_conditionalOrExpression629); if (state.failed) return retval;
            	    if ( state.backtracking==0 ) {
            	    string_literal98_tree = (Object)adaptor.create(string_literal98);
            	    root_0 = (Object)adaptor.becomeRoot(string_literal98_tree, root_0);
            	    }
            	    pushFollow(FOLLOW_conditionalAndExpression_in_conditionalOrExpression632);
            	    conditionalAndExpression99=conditionalAndExpression();

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, conditionalAndExpression99.getTree());

            	    }
            	    break;

            	default :
            	    break loop17;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "conditionalOrExpression"

    public static class conditionalAndExpression_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "conditionalAndExpression"
    // RiseCollectionFormula.g:108:1: conditionalAndExpression : equalityExpression ( '&&' equalityExpression )* ;
    public final RiseCollectionFormulaParser.conditionalAndExpression_return conditionalAndExpression() throws RecognitionException {
        RiseCollectionFormulaParser.conditionalAndExpression_return retval = new RiseCollectionFormulaParser.conditionalAndExpression_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token string_literal101=null;
        RiseCollectionFormulaParser.equalityExpression_return equalityExpression100 = null;

        RiseCollectionFormulaParser.equalityExpression_return equalityExpression102 = null;


        Object string_literal101_tree=null;

        try {
            // RiseCollectionFormula.g:109:6: ( equalityExpression ( '&&' equalityExpression )* )
            // RiseCollectionFormula.g:109:10: equalityExpression ( '&&' equalityExpression )*
            {
            root_0 = (Object)adaptor.nil();

            pushFollow(FOLLOW_equalityExpression_in_conditionalAndExpression660);
            equalityExpression100=equalityExpression();

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) adaptor.addChild(root_0, equalityExpression100.getTree());
            // RiseCollectionFormula.g:109:29: ( '&&' equalityExpression )*
            loop18:
            do {
                int alt18=2;
                int LA18_0 = input.LA(1);

                if ( (LA18_0==52) ) {
                    alt18=1;
                }


                switch (alt18) {
            	case 1 :
            	    // RiseCollectionFormula.g:109:31: '&&' equalityExpression
            	    {
            	    string_literal101=(Token)match(input,52,FOLLOW_52_in_conditionalAndExpression664); if (state.failed) return retval;
            	    if ( state.backtracking==0 ) {
            	    string_literal101_tree = (Object)adaptor.create(string_literal101);
            	    root_0 = (Object)adaptor.becomeRoot(string_literal101_tree, root_0);
            	    }
            	    pushFollow(FOLLOW_equalityExpression_in_conditionalAndExpression667);
            	    equalityExpression102=equalityExpression();

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, equalityExpression102.getTree());

            	    }
            	    break;

            	default :
            	    break loop18;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "conditionalAndExpression"

    public static class equalityExpression_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "equalityExpression"
    // RiseCollectionFormula.g:112:1: equalityExpression : relationalExpression ( ( '==' | '!=' | '<>' | '>=' | '<=' | '>' | '<' ) relationalExpression )* ;
    public final RiseCollectionFormulaParser.equalityExpression_return equalityExpression() throws RecognitionException {
        RiseCollectionFormulaParser.equalityExpression_return retval = new RiseCollectionFormulaParser.equalityExpression_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token string_literal104=null;
        Token string_literal105=null;
        Token string_literal106=null;
        Token string_literal107=null;
        Token string_literal108=null;
        Token char_literal109=null;
        Token char_literal110=null;
        RiseCollectionFormulaParser.relationalExpression_return relationalExpression103 = null;

        RiseCollectionFormulaParser.relationalExpression_return relationalExpression111 = null;


        Object string_literal104_tree=null;
        Object string_literal105_tree=null;
        Object string_literal106_tree=null;
        Object string_literal107_tree=null;
        Object string_literal108_tree=null;
        Object char_literal109_tree=null;
        Object char_literal110_tree=null;

        try {
            // RiseCollectionFormula.g:113:6: ( relationalExpression ( ( '==' | '!=' | '<>' | '>=' | '<=' | '>' | '<' ) relationalExpression )* )
            // RiseCollectionFormula.g:113:10: relationalExpression ( ( '==' | '!=' | '<>' | '>=' | '<=' | '>' | '<' ) relationalExpression )*
            {
            root_0 = (Object)adaptor.nil();

            pushFollow(FOLLOW_relationalExpression_in_equalityExpression695);
            relationalExpression103=relationalExpression();

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) adaptor.addChild(root_0, relationalExpression103.getTree());
            // RiseCollectionFormula.g:113:31: ( ( '==' | '!=' | '<>' | '>=' | '<=' | '>' | '<' ) relationalExpression )*
            loop20:
            do {
                int alt20=2;
                int LA20_0 = input.LA(1);

                if ( ((LA20_0>=53 && LA20_0<=59)) ) {
                    alt20=1;
                }


                switch (alt20) {
            	case 1 :
            	    // RiseCollectionFormula.g:113:33: ( '==' | '!=' | '<>' | '>=' | '<=' | '>' | '<' ) relationalExpression
            	    {
            	    // RiseCollectionFormula.g:113:33: ( '==' | '!=' | '<>' | '>=' | '<=' | '>' | '<' )
            	    int alt19=7;
            	    switch ( input.LA(1) ) {
            	    case 53:
            	        {
            	        alt19=1;
            	        }
            	        break;
            	    case 54:
            	        {
            	        alt19=2;
            	        }
            	        break;
            	    case 55:
            	        {
            	        alt19=3;
            	        }
            	        break;
            	    case 56:
            	        {
            	        alt19=4;
            	        }
            	        break;
            	    case 57:
            	        {
            	        alt19=5;
            	        }
            	        break;
            	    case 58:
            	        {
            	        alt19=6;
            	        }
            	        break;
            	    case 59:
            	        {
            	        alt19=7;
            	        }
            	        break;
            	    default:
            	        if (state.backtracking>0) {state.failed=true; return retval;}
            	        NoViableAltException nvae =
            	            new NoViableAltException("", 19, 0, input);

            	        throw nvae;
            	    }

            	    switch (alt19) {
            	        case 1 :
            	            // RiseCollectionFormula.g:113:34: '=='
            	            {
            	            string_literal104=(Token)match(input,53,FOLLOW_53_in_equalityExpression700); if (state.failed) return retval;
            	            if ( state.backtracking==0 ) {
            	            string_literal104_tree = (Object)adaptor.create(string_literal104);
            	            root_0 = (Object)adaptor.becomeRoot(string_literal104_tree, root_0);
            	            }

            	            }
            	            break;
            	        case 2 :
            	            // RiseCollectionFormula.g:113:42: '!='
            	            {
            	            string_literal105=(Token)match(input,54,FOLLOW_54_in_equalityExpression705); if (state.failed) return retval;
            	            if ( state.backtracking==0 ) {
            	            string_literal105_tree = (Object)adaptor.create(string_literal105);
            	            root_0 = (Object)adaptor.becomeRoot(string_literal105_tree, root_0);
            	            }

            	            }
            	            break;
            	        case 3 :
            	            // RiseCollectionFormula.g:113:50: '<>'
            	            {
            	            string_literal106=(Token)match(input,55,FOLLOW_55_in_equalityExpression710); if (state.failed) return retval;
            	            if ( state.backtracking==0 ) {
            	            string_literal106_tree = (Object)adaptor.create(string_literal106);
            	            root_0 = (Object)adaptor.becomeRoot(string_literal106_tree, root_0);
            	            }

            	            }
            	            break;
            	        case 4 :
            	            // RiseCollectionFormula.g:113:58: '>='
            	            {
            	            string_literal107=(Token)match(input,56,FOLLOW_56_in_equalityExpression715); if (state.failed) return retval;
            	            if ( state.backtracking==0 ) {
            	            string_literal107_tree = (Object)adaptor.create(string_literal107);
            	            root_0 = (Object)adaptor.becomeRoot(string_literal107_tree, root_0);
            	            }

            	            }
            	            break;
            	        case 5 :
            	            // RiseCollectionFormula.g:113:66: '<='
            	            {
            	            string_literal108=(Token)match(input,57,FOLLOW_57_in_equalityExpression720); if (state.failed) return retval;
            	            if ( state.backtracking==0 ) {
            	            string_literal108_tree = (Object)adaptor.create(string_literal108);
            	            root_0 = (Object)adaptor.becomeRoot(string_literal108_tree, root_0);
            	            }

            	            }
            	            break;
            	        case 6 :
            	            // RiseCollectionFormula.g:113:74: '>'
            	            {
            	            char_literal109=(Token)match(input,58,FOLLOW_58_in_equalityExpression725); if (state.failed) return retval;
            	            if ( state.backtracking==0 ) {
            	            char_literal109_tree = (Object)adaptor.create(char_literal109);
            	            root_0 = (Object)adaptor.becomeRoot(char_literal109_tree, root_0);
            	            }

            	            }
            	            break;
            	        case 7 :
            	            // RiseCollectionFormula.g:113:81: '<'
            	            {
            	            char_literal110=(Token)match(input,59,FOLLOW_59_in_equalityExpression730); if (state.failed) return retval;
            	            if ( state.backtracking==0 ) {
            	            char_literal110_tree = (Object)adaptor.create(char_literal110);
            	            root_0 = (Object)adaptor.becomeRoot(char_literal110_tree, root_0);
            	            }

            	            }
            	            break;

            	    }

            	    pushFollow(FOLLOW_relationalExpression_in_equalityExpression734);
            	    relationalExpression111=relationalExpression();

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, relationalExpression111.getTree());

            	    }
            	    break;

            	default :
            	    break loop20;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "equalityExpression"

    public static class relationalExpression_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "relationalExpression"
    // RiseCollectionFormula.g:116:1: relationalExpression : additiveExpression ( additiveExpression )* ;
    public final RiseCollectionFormulaParser.relationalExpression_return relationalExpression() throws RecognitionException {
        RiseCollectionFormulaParser.relationalExpression_return retval = new RiseCollectionFormulaParser.relationalExpression_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        RiseCollectionFormulaParser.additiveExpression_return additiveExpression112 = null;

        RiseCollectionFormulaParser.additiveExpression_return additiveExpression113 = null;



        try {
            // RiseCollectionFormula.g:117:6: ( additiveExpression ( additiveExpression )* )
            // RiseCollectionFormula.g:117:10: additiveExpression ( additiveExpression )*
            {
            root_0 = (Object)adaptor.nil();

            pushFollow(FOLLOW_additiveExpression_in_relationalExpression762);
            additiveExpression112=additiveExpression();

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) adaptor.addChild(root_0, additiveExpression112.getTree());
            // RiseCollectionFormula.g:117:29: ( additiveExpression )*
            loop21:
            do {
                int alt21=2;
                switch ( input.LA(1) ) {
                case RANGECELL:
                    {
                    int LA21_2 = input.LA(2);

                    if ( (LA21_2==EOF||(LA21_2>=FOR && LA21_2<=Identifier)||(LA21_2>=OPEN && LA21_2<=DecimalLiteral)||(LA21_2>=SURE && LA21_2<=StringLiteral)||(LA21_2>=RANGECELL && LA21_2<=ABS)||(LA21_2>=FloatingPointLiteral && LA21_2<=CharacterLiteral)||(LA21_2>=45 && LA21_2<=48)||(LA21_2>=51 && LA21_2<=67)) ) {
                        alt21=1;
                    }


                    }
                    break;
                case Identifier:
                    {
                    int LA21_3 = input.LA(2);

                    if ( (LA21_3==EOF||(LA21_3>=FOR && LA21_3<=Identifier)||(LA21_3>=OPEN && LA21_3<=DecimalLiteral)||(LA21_3>=SURE && LA21_3<=StringLiteral)||(LA21_3>=RANGECELL && LA21_3<=ABS)||(LA21_3>=FloatingPointLiteral && LA21_3<=CharacterLiteral)||(LA21_3>=45 && LA21_3<=48)||(LA21_3>=51 && LA21_3<=63)||(LA21_3>=65 && LA21_3<=67)) ) {
                        alt21=1;
                    }


                    }
                    break;
                case DecimalLiteral:
                case StringLiteral:
                case ZZJGDM:
                case TBR:
                case BGQ:
                case TBRQ:
                case QYMC:
                case LEN:
                case NOTEMPTY:
                case EMPTY:
                case ABS:
                case FloatingPointLiteral:
                case CharacterLiteral:
                case 45:
                case 46:
                case 60:
                case 65:
                case 66:
                case 67:
                    {
                    alt21=1;
                    }
                    break;
                case INDICATIONCELL:
                    {
                    int LA21_5 = input.LA(2);

                    if ( (LA21_5==EOF||(LA21_5>=FOR && LA21_5<=Identifier)||(LA21_5>=OPEN && LA21_5<=DecimalLiteral)||(LA21_5>=SURE && LA21_5<=StringLiteral)||(LA21_5>=RANGECELL && LA21_5<=ABS)||(LA21_5>=FloatingPointLiteral && LA21_5<=CharacterLiteral)||(LA21_5>=45 && LA21_5<=48)||(LA21_5>=51 && LA21_5<=63)||(LA21_5>=65 && LA21_5<=67)) ) {
                        alt21=1;
                    }


                    }
                    break;

                }

                switch (alt21) {
            	case 1 :
            	    // RiseCollectionFormula.g:117:31: additiveExpression
            	    {
            	    pushFollow(FOLLOW_additiveExpression_in_relationalExpression766);
            	    additiveExpression113=additiveExpression();

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, additiveExpression113.getTree());

            	    }
            	    break;

            	default :
            	    break loop21;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "relationalExpression"

    public static class additiveExpression_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "additiveExpression"
    // RiseCollectionFormula.g:120:1: additiveExpression : multiplicativeExpression ( '+' multiplicativeExpression | '-' multiplicativeExpression )* ;
    public final RiseCollectionFormulaParser.additiveExpression_return additiveExpression() throws RecognitionException {
        RiseCollectionFormulaParser.additiveExpression_return retval = new RiseCollectionFormulaParser.additiveExpression_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token char_literal115=null;
        Token char_literal117=null;
        RiseCollectionFormulaParser.multiplicativeExpression_return multiplicativeExpression114 = null;

        RiseCollectionFormulaParser.multiplicativeExpression_return multiplicativeExpression116 = null;

        RiseCollectionFormulaParser.multiplicativeExpression_return multiplicativeExpression118 = null;


        Object char_literal115_tree=null;
        Object char_literal117_tree=null;

        try {
            // RiseCollectionFormula.g:121:6: ( multiplicativeExpression ( '+' multiplicativeExpression | '-' multiplicativeExpression )* )
            // RiseCollectionFormula.g:121:10: multiplicativeExpression ( '+' multiplicativeExpression | '-' multiplicativeExpression )*
            {
            root_0 = (Object)adaptor.nil();

            pushFollow(FOLLOW_multiplicativeExpression_in_additiveExpression796);
            multiplicativeExpression114=multiplicativeExpression();

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) adaptor.addChild(root_0, multiplicativeExpression114.getTree());
            // RiseCollectionFormula.g:121:34: ( '+' multiplicativeExpression | '-' multiplicativeExpression )*
            loop22:
            do {
                int alt22=3;
                alt22 = dfa22.predict(input);
                switch (alt22) {
            	case 1 :
            	    // RiseCollectionFormula.g:121:35: '+' multiplicativeExpression
            	    {
            	    char_literal115=(Token)match(input,60,FOLLOW_60_in_additiveExpression798); if (state.failed) return retval;
            	    if ( state.backtracking==0 ) {
            	    char_literal115_tree = (Object)adaptor.create(char_literal115);
            	    root_0 = (Object)adaptor.becomeRoot(char_literal115_tree, root_0);
            	    }
            	    pushFollow(FOLLOW_multiplicativeExpression_in_additiveExpression801);
            	    multiplicativeExpression116=multiplicativeExpression();

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, multiplicativeExpression116.getTree());

            	    }
            	    break;
            	case 2 :
            	    // RiseCollectionFormula.g:121:67: '-' multiplicativeExpression
            	    {
            	    char_literal117=(Token)match(input,45,FOLLOW_45_in_additiveExpression805); if (state.failed) return retval;
            	    if ( state.backtracking==0 ) {
            	    char_literal117_tree = (Object)adaptor.create(char_literal117);
            	    root_0 = (Object)adaptor.becomeRoot(char_literal117_tree, root_0);
            	    }
            	    pushFollow(FOLLOW_multiplicativeExpression_in_additiveExpression808);
            	    multiplicativeExpression118=multiplicativeExpression();

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, multiplicativeExpression118.getTree());

            	    }
            	    break;

            	default :
            	    break loop22;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "additiveExpression"

    public static class multiplicativeExpression_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "multiplicativeExpression"
    // RiseCollectionFormula.g:124:1: multiplicativeExpression : ( unaryExpression ( '*' unaryExpression | '/' unaryExpression | '%' unaryExpression )* | continuousAddExpression );
    public final RiseCollectionFormulaParser.multiplicativeExpression_return multiplicativeExpression() throws RecognitionException {
        RiseCollectionFormulaParser.multiplicativeExpression_return retval = new RiseCollectionFormulaParser.multiplicativeExpression_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token char_literal120=null;
        Token char_literal122=null;
        Token char_literal124=null;
        RiseCollectionFormulaParser.unaryExpression_return unaryExpression119 = null;

        RiseCollectionFormulaParser.unaryExpression_return unaryExpression121 = null;

        RiseCollectionFormulaParser.unaryExpression_return unaryExpression123 = null;

        RiseCollectionFormulaParser.unaryExpression_return unaryExpression125 = null;

        RiseCollectionFormulaParser.continuousAddExpression_return continuousAddExpression126 = null;


        Object char_literal120_tree=null;
        Object char_literal122_tree=null;
        Object char_literal124_tree=null;

        try {
            // RiseCollectionFormula.g:125:6: ( unaryExpression ( '*' unaryExpression | '/' unaryExpression | '%' unaryExpression )* | continuousAddExpression )
            int alt24=2;
            int LA24_0 = input.LA(1);

            if ( (LA24_0==Identifier||LA24_0==DecimalLiteral||LA24_0==StringLiteral||(LA24_0>=INDICATIONCELL && LA24_0<=ABS)||(LA24_0>=FloatingPointLiteral && LA24_0<=CharacterLiteral)||(LA24_0>=45 && LA24_0<=46)||LA24_0==60||(LA24_0>=65 && LA24_0<=67)) ) {
                alt24=1;
            }
            else if ( (LA24_0==RANGECELL) ) {
                int LA24_2 = input.LA(2);

                if ( (LA24_2==64) ) {
                    alt24=2;
                }
                else if ( (LA24_2==EOF||(LA24_2>=FOR && LA24_2<=Identifier)||(LA24_2>=OPEN && LA24_2<=DecimalLiteral)||(LA24_2>=SURE && LA24_2<=StringLiteral)||(LA24_2>=RANGECELL && LA24_2<=ABS)||(LA24_2>=FloatingPointLiteral && LA24_2<=CharacterLiteral)||(LA24_2>=45 && LA24_2<=48)||(LA24_2>=51 && LA24_2<=63)||(LA24_2>=65 && LA24_2<=67)) ) {
                    alt24=1;
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 24, 2, input);

                    throw nvae;
                }
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 24, 0, input);

                throw nvae;
            }
            switch (alt24) {
                case 1 :
                    // RiseCollectionFormula.g:125:10: unaryExpression ( '*' unaryExpression | '/' unaryExpression | '%' unaryExpression )*
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_unaryExpression_in_multiplicativeExpression833);
                    unaryExpression119=unaryExpression();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, unaryExpression119.getTree());
                    // RiseCollectionFormula.g:125:25: ( '*' unaryExpression | '/' unaryExpression | '%' unaryExpression )*
                    loop23:
                    do {
                        int alt23=4;
                        switch ( input.LA(1) ) {
                        case 61:
                            {
                            alt23=1;
                            }
                            break;
                        case 62:
                            {
                            alt23=2;
                            }
                            break;
                        case 63:
                            {
                            alt23=3;
                            }
                            break;

                        }

                        switch (alt23) {
                    	case 1 :
                    	    // RiseCollectionFormula.g:125:26: '*' unaryExpression
                    	    {
                    	    char_literal120=(Token)match(input,61,FOLLOW_61_in_multiplicativeExpression835); if (state.failed) return retval;
                    	    if ( state.backtracking==0 ) {
                    	    char_literal120_tree = (Object)adaptor.create(char_literal120);
                    	    root_0 = (Object)adaptor.becomeRoot(char_literal120_tree, root_0);
                    	    }
                    	    pushFollow(FOLLOW_unaryExpression_in_multiplicativeExpression838);
                    	    unaryExpression121=unaryExpression();

                    	    state._fsp--;
                    	    if (state.failed) return retval;
                    	    if ( state.backtracking==0 ) adaptor.addChild(root_0, unaryExpression121.getTree());

                    	    }
                    	    break;
                    	case 2 :
                    	    // RiseCollectionFormula.g:125:49: '/' unaryExpression
                    	    {
                    	    char_literal122=(Token)match(input,62,FOLLOW_62_in_multiplicativeExpression842); if (state.failed) return retval;
                    	    if ( state.backtracking==0 ) {
                    	    char_literal122_tree = (Object)adaptor.create(char_literal122);
                    	    root_0 = (Object)adaptor.becomeRoot(char_literal122_tree, root_0);
                    	    }
                    	    pushFollow(FOLLOW_unaryExpression_in_multiplicativeExpression845);
                    	    unaryExpression123=unaryExpression();

                    	    state._fsp--;
                    	    if (state.failed) return retval;
                    	    if ( state.backtracking==0 ) adaptor.addChild(root_0, unaryExpression123.getTree());

                    	    }
                    	    break;
                    	case 3 :
                    	    // RiseCollectionFormula.g:125:72: '%' unaryExpression
                    	    {
                    	    char_literal124=(Token)match(input,63,FOLLOW_63_in_multiplicativeExpression849); if (state.failed) return retval;
                    	    if ( state.backtracking==0 ) {
                    	    char_literal124_tree = (Object)adaptor.create(char_literal124);
                    	    root_0 = (Object)adaptor.becomeRoot(char_literal124_tree, root_0);
                    	    }
                    	    pushFollow(FOLLOW_unaryExpression_in_multiplicativeExpression852);
                    	    unaryExpression125=unaryExpression();

                    	    state._fsp--;
                    	    if (state.failed) return retval;
                    	    if ( state.backtracking==0 ) adaptor.addChild(root_0, unaryExpression125.getTree());

                    	    }
                    	    break;

                    	default :
                    	    break loop23;
                        }
                    } while (true);


                    }
                    break;
                case 2 :
                    // RiseCollectionFormula.g:126:8: continuousAddExpression
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_continuousAddExpression_in_multiplicativeExpression863);
                    continuousAddExpression126=continuousAddExpression();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, continuousAddExpression126.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "multiplicativeExpression"

    public static class continuousAddExpression_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "continuousAddExpression"
    // RiseCollectionFormula.g:129:1: continuousAddExpression : RANGECELL '+...+' RANGECELL -> ^( '+...+' RANGECELL RANGECELL ) ;
    public final RiseCollectionFormulaParser.continuousAddExpression_return continuousAddExpression() throws RecognitionException {
        RiseCollectionFormulaParser.continuousAddExpression_return retval = new RiseCollectionFormulaParser.continuousAddExpression_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token RANGECELL127=null;
        Token string_literal128=null;
        Token RANGECELL129=null;

        Object RANGECELL127_tree=null;
        Object string_literal128_tree=null;
        Object RANGECELL129_tree=null;
        RewriteRuleTokenStream stream_RANGECELL=new RewriteRuleTokenStream(adaptor,"token RANGECELL");
        RewriteRuleTokenStream stream_64=new RewriteRuleTokenStream(adaptor,"token 64");

        try {
            // RiseCollectionFormula.g:130:2: ( RANGECELL '+...+' RANGECELL -> ^( '+...+' RANGECELL RANGECELL ) )
            // RiseCollectionFormula.g:130:4: RANGECELL '+...+' RANGECELL
            {
            RANGECELL127=(Token)match(input,RANGECELL,FOLLOW_RANGECELL_in_continuousAddExpression883); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_RANGECELL.add(RANGECELL127);

            string_literal128=(Token)match(input,64,FOLLOW_64_in_continuousAddExpression885); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_64.add(string_literal128);

            RANGECELL129=(Token)match(input,RANGECELL,FOLLOW_RANGECELL_in_continuousAddExpression887); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_RANGECELL.add(RANGECELL129);



            // AST REWRITE
            // elements: 64, RANGECELL, RANGECELL
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            if ( state.backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 131:2: -> ^( '+...+' RANGECELL RANGECELL )
            {
                // RiseCollectionFormula.g:131:5: ^( '+...+' RANGECELL RANGECELL )
                {
                Object root_1 = (Object)adaptor.nil();
                root_1 = (Object)adaptor.becomeRoot(stream_64.nextNode(), root_1);

                adaptor.addChild(root_1, stream_RANGECELL.nextNode());
                adaptor.addChild(root_1, stream_RANGECELL.nextNode());

                adaptor.addChild(root_0, root_1);
                }

            }

            retval.tree = root_0;}
            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "continuousAddExpression"

    public static class unaryExpression_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "unaryExpression"
    // RiseCollectionFormula.g:134:1: unaryExpression : ( '+' unaryExpression | '-' unaryExpression | primary );
    public final RiseCollectionFormulaParser.unaryExpression_return unaryExpression() throws RecognitionException {
        RiseCollectionFormulaParser.unaryExpression_return retval = new RiseCollectionFormulaParser.unaryExpression_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token char_literal130=null;
        Token char_literal132=null;
        RiseCollectionFormulaParser.unaryExpression_return unaryExpression131 = null;

        RiseCollectionFormulaParser.unaryExpression_return unaryExpression133 = null;

        RiseCollectionFormulaParser.primary_return primary134 = null;


        Object char_literal130_tree=null;
        Object char_literal132_tree=null;

        try {
            // RiseCollectionFormula.g:135:6: ( '+' unaryExpression | '-' unaryExpression | primary )
            int alt25=3;
            switch ( input.LA(1) ) {
            case 60:
                {
                alt25=1;
                }
                break;
            case 45:
                {
                alt25=2;
                }
                break;
            case Identifier:
            case DecimalLiteral:
            case StringLiteral:
            case RANGECELL:
            case INDICATIONCELL:
            case ZZJGDM:
            case TBR:
            case BGQ:
            case TBRQ:
            case QYMC:
            case LEN:
            case NOTEMPTY:
            case EMPTY:
            case ABS:
            case FloatingPointLiteral:
            case CharacterLiteral:
            case 46:
            case 65:
            case 66:
            case 67:
                {
                alt25=3;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 25, 0, input);

                throw nvae;
            }

            switch (alt25) {
                case 1 :
                    // RiseCollectionFormula.g:135:10: '+' unaryExpression
                    {
                    root_0 = (Object)adaptor.nil();

                    char_literal130=(Token)match(input,60,FOLLOW_60_in_unaryExpression920); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    char_literal130_tree = (Object)adaptor.create(char_literal130);
                    root_0 = (Object)adaptor.becomeRoot(char_literal130_tree, root_0);
                    }
                    pushFollow(FOLLOW_unaryExpression_in_unaryExpression923);
                    unaryExpression131=unaryExpression();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, unaryExpression131.getTree());

                    }
                    break;
                case 2 :
                    // RiseCollectionFormula.g:136:10: '-' unaryExpression
                    {
                    root_0 = (Object)adaptor.nil();

                    char_literal132=(Token)match(input,45,FOLLOW_45_in_unaryExpression934); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    char_literal132_tree = (Object)adaptor.create(char_literal132);
                    root_0 = (Object)adaptor.becomeRoot(char_literal132_tree, root_0);
                    }
                    pushFollow(FOLLOW_unaryExpression_in_unaryExpression937);
                    unaryExpression133=unaryExpression();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, unaryExpression133.getTree());

                    }
                    break;
                case 3 :
                    // RiseCollectionFormula.g:137:10: primary
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_primary_in_unaryExpression948);
                    primary134=primary();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, primary134.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "unaryExpression"

    public static class primary_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "primary"
    // RiseCollectionFormula.g:140:1: primary : ( parExpression | functionExpression | Identifier | reportkeywords | reference | literal );
    public final RiseCollectionFormulaParser.primary_return primary() throws RecognitionException {
        RiseCollectionFormulaParser.primary_return retval = new RiseCollectionFormulaParser.primary_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token Identifier137=null;
        RiseCollectionFormulaParser.parExpression_return parExpression135 = null;

        RiseCollectionFormulaParser.functionExpression_return functionExpression136 = null;

        RiseCollectionFormulaParser.reportkeywords_return reportkeywords138 = null;

        RiseCollectionFormulaParser.reference_return reference139 = null;

        RiseCollectionFormulaParser.literal_return literal140 = null;


        Object Identifier137_tree=null;

        try {
            // RiseCollectionFormula.g:141:6: ( parExpression | functionExpression | Identifier | reportkeywords | reference | literal )
            int alt26=6;
            switch ( input.LA(1) ) {
            case 46:
                {
                alt26=1;
                }
                break;
            case LEN:
            case NOTEMPTY:
            case EMPTY:
            case ABS:
                {
                alt26=2;
                }
                break;
            case Identifier:
                {
                alt26=3;
                }
                break;
            case RANGECELL:
            case INDICATIONCELL:
                {
                alt26=4;
                }
                break;
            case ZZJGDM:
            case TBR:
            case BGQ:
            case TBRQ:
            case QYMC:
                {
                alt26=5;
                }
                break;
            case DecimalLiteral:
            case StringLiteral:
            case FloatingPointLiteral:
            case CharacterLiteral:
            case 65:
            case 66:
            case 67:
                {
                alt26=6;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 26, 0, input);

                throw nvae;
            }

            switch (alt26) {
                case 1 :
                    // RiseCollectionFormula.g:141:11: parExpression
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_parExpression_in_primary974);
                    parExpression135=parExpression();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, parExpression135.getTree());

                    }
                    break;
                case 2 :
                    // RiseCollectionFormula.g:142:8: functionExpression
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_functionExpression_in_primary983);
                    functionExpression136=functionExpression();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, functionExpression136.getTree());

                    }
                    break;
                case 3 :
                    // RiseCollectionFormula.g:143:11: Identifier
                    {
                    root_0 = (Object)adaptor.nil();

                    Identifier137=(Token)match(input,Identifier,FOLLOW_Identifier_in_primary995); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    Identifier137_tree = (Object)adaptor.create(Identifier137);
                    adaptor.addChild(root_0, Identifier137_tree);
                    }

                    }
                    break;
                case 4 :
                    // RiseCollectionFormula.g:144:8: reportkeywords
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_reportkeywords_in_primary1004);
                    reportkeywords138=reportkeywords();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, reportkeywords138.getTree());

                    }
                    break;
                case 5 :
                    // RiseCollectionFormula.g:145:8: reference
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_reference_in_primary1013);
                    reference139=reference();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, reference139.getTree());

                    }
                    break;
                case 6 :
                    // RiseCollectionFormula.g:146:11: literal
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_literal_in_primary1025);
                    literal140=literal();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, literal140.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "primary"

    public static class assignkeywords_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "assignkeywords"
    // RiseCollectionFormula.g:149:1: assignkeywords : ( INDICATIONCELL | RANGECELL );
    public final RiseCollectionFormulaParser.assignkeywords_return assignkeywords() throws RecognitionException {
        RiseCollectionFormulaParser.assignkeywords_return retval = new RiseCollectionFormulaParser.assignkeywords_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token set141=null;

        Object set141_tree=null;

        try {
            // RiseCollectionFormula.g:150:2: ( INDICATIONCELL | RANGECELL )
            // RiseCollectionFormula.g:
            {
            root_0 = (Object)adaptor.nil();

            set141=(Token)input.LT(1);
            if ( (input.LA(1)>=RANGECELL && input.LA(1)<=INDICATIONCELL) ) {
                input.consume();
                if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(set141));
                state.errorRecovery=false;state.failed=false;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "assignkeywords"

    public static class reportkeywords_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "reportkeywords"
    // RiseCollectionFormula.g:154:1: reportkeywords : ( INDICATIONCELL | RANGECELL );
    public final RiseCollectionFormulaParser.reportkeywords_return reportkeywords() throws RecognitionException {
        RiseCollectionFormulaParser.reportkeywords_return retval = new RiseCollectionFormulaParser.reportkeywords_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token set142=null;

        Object set142_tree=null;

        try {
            // RiseCollectionFormula.g:155:2: ( INDICATIONCELL | RANGECELL )
            // RiseCollectionFormula.g:
            {
            root_0 = (Object)adaptor.nil();

            set142=(Token)input.LT(1);
            if ( (input.LA(1)>=RANGECELL && input.LA(1)<=INDICATIONCELL) ) {
                input.consume();
                if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(set142));
                state.errorRecovery=false;state.failed=false;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "reportkeywords"

    public static class referenceassign_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "referenceassign"
    // RiseCollectionFormula.g:159:1: referenceassign : ( ZZJGDM | TBR | BGQ | TBRQ | QYMC );
    public final RiseCollectionFormulaParser.referenceassign_return referenceassign() throws RecognitionException {
        RiseCollectionFormulaParser.referenceassign_return retval = new RiseCollectionFormulaParser.referenceassign_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token set143=null;

        Object set143_tree=null;

        try {
            // RiseCollectionFormula.g:160:2: ( ZZJGDM | TBR | BGQ | TBRQ | QYMC )
            // RiseCollectionFormula.g:
            {
            root_0 = (Object)adaptor.nil();

            set143=(Token)input.LT(1);
            if ( (input.LA(1)>=ZZJGDM && input.LA(1)<=QYMC) ) {
                input.consume();
                if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(set143));
                state.errorRecovery=false;state.failed=false;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "referenceassign"

    public static class reference_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "reference"
    // RiseCollectionFormula.g:167:1: reference : ( ZZJGDM | TBR | BGQ | TBRQ | QYMC );
    public final RiseCollectionFormulaParser.reference_return reference() throws RecognitionException {
        RiseCollectionFormulaParser.reference_return retval = new RiseCollectionFormulaParser.reference_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token set144=null;

        Object set144_tree=null;

        try {
            // RiseCollectionFormula.g:168:2: ( ZZJGDM | TBR | BGQ | TBRQ | QYMC )
            // RiseCollectionFormula.g:
            {
            root_0 = (Object)adaptor.nil();

            set144=(Token)input.LT(1);
            if ( (input.LA(1)>=ZZJGDM && input.LA(1)<=QYMC) ) {
                input.consume();
                if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(set144));
                state.errorRecovery=false;state.failed=false;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "reference"

    public static class parExpression_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "parExpression"
    // RiseCollectionFormula.g:175:1: parExpression : '(' expression ')' -> ^( '(' expression ')' ) ;
    public final RiseCollectionFormulaParser.parExpression_return parExpression() throws RecognitionException {
        RiseCollectionFormulaParser.parExpression_return retval = new RiseCollectionFormulaParser.parExpression_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token char_literal145=null;
        Token char_literal147=null;
        RiseCollectionFormulaParser.expression_return expression146 = null;


        Object char_literal145_tree=null;
        Object char_literal147_tree=null;
        RewriteRuleTokenStream stream_46=new RewriteRuleTokenStream(adaptor,"token 46");
        RewriteRuleTokenStream stream_47=new RewriteRuleTokenStream(adaptor,"token 47");
        RewriteRuleSubtreeStream stream_expression=new RewriteRuleSubtreeStream(adaptor,"rule expression");
        try {
            // RiseCollectionFormula.g:176:5: ( '(' expression ')' -> ^( '(' expression ')' ) )
            // RiseCollectionFormula.g:176:9: '(' expression ')'
            {
            char_literal145=(Token)match(input,46,FOLLOW_46_in_parExpression1190); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_46.add(char_literal145);

            pushFollow(FOLLOW_expression_in_parExpression1192);
            expression146=expression();

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) stream_expression.add(expression146.getTree());
            char_literal147=(Token)match(input,47,FOLLOW_47_in_parExpression1194); if (state.failed) return retval; 
            if ( state.backtracking==0 ) stream_47.add(char_literal147);



            // AST REWRITE
            // elements: 47, 46, expression
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            if ( state.backtracking==0 ) {
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

            root_0 = (Object)adaptor.nil();
            // 176:28: -> ^( '(' expression ')' )
            {
                // RiseCollectionFormula.g:176:30: ^( '(' expression ')' )
                {
                Object root_1 = (Object)adaptor.nil();
                root_1 = (Object)adaptor.becomeRoot(stream_46.nextNode(), root_1);

                adaptor.addChild(root_1, stream_expression.nextTree());
                adaptor.addChild(root_1, stream_47.nextNode());

                adaptor.addChild(root_0, root_1);
                }

            }

            retval.tree = root_0;}
            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "parExpression"

    public static class functionExpression_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "functionExpression"
    // RiseCollectionFormula.g:179:1: functionExpression : ( LEN '(' assignkeywords ')' -> ^( LEN assignkeywords ) | NOTEMPTY '(' assignkeywords ')' -> ^( NOTEMPTY assignkeywords ) | EMPTY '(' assignkeywords ')' -> ^( EMPTY assignkeywords ) | ABS '(' assignkeywords ')' -> ^( ABS assignkeywords ) );
    public final RiseCollectionFormulaParser.functionExpression_return functionExpression() throws RecognitionException {
        RiseCollectionFormulaParser.functionExpression_return retval = new RiseCollectionFormulaParser.functionExpression_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token LEN148=null;
        Token char_literal149=null;
        Token char_literal151=null;
        Token NOTEMPTY152=null;
        Token char_literal153=null;
        Token char_literal155=null;
        Token EMPTY156=null;
        Token char_literal157=null;
        Token char_literal159=null;
        Token ABS160=null;
        Token char_literal161=null;
        Token char_literal163=null;
        RiseCollectionFormulaParser.assignkeywords_return assignkeywords150 = null;

        RiseCollectionFormulaParser.assignkeywords_return assignkeywords154 = null;

        RiseCollectionFormulaParser.assignkeywords_return assignkeywords158 = null;

        RiseCollectionFormulaParser.assignkeywords_return assignkeywords162 = null;


        Object LEN148_tree=null;
        Object char_literal149_tree=null;
        Object char_literal151_tree=null;
        Object NOTEMPTY152_tree=null;
        Object char_literal153_tree=null;
        Object char_literal155_tree=null;
        Object EMPTY156_tree=null;
        Object char_literal157_tree=null;
        Object char_literal159_tree=null;
        Object ABS160_tree=null;
        Object char_literal161_tree=null;
        Object char_literal163_tree=null;
        RewriteRuleTokenStream stream_EMPTY=new RewriteRuleTokenStream(adaptor,"token EMPTY");
        RewriteRuleTokenStream stream_ABS=new RewriteRuleTokenStream(adaptor,"token ABS");
        RewriteRuleTokenStream stream_46=new RewriteRuleTokenStream(adaptor,"token 46");
        RewriteRuleTokenStream stream_NOTEMPTY=new RewriteRuleTokenStream(adaptor,"token NOTEMPTY");
        RewriteRuleTokenStream stream_LEN=new RewriteRuleTokenStream(adaptor,"token LEN");
        RewriteRuleTokenStream stream_47=new RewriteRuleTokenStream(adaptor,"token 47");
        RewriteRuleSubtreeStream stream_assignkeywords=new RewriteRuleSubtreeStream(adaptor,"rule assignkeywords");
        try {
            // RiseCollectionFormula.g:180:2: ( LEN '(' assignkeywords ')' -> ^( LEN assignkeywords ) | NOTEMPTY '(' assignkeywords ')' -> ^( NOTEMPTY assignkeywords ) | EMPTY '(' assignkeywords ')' -> ^( EMPTY assignkeywords ) | ABS '(' assignkeywords ')' -> ^( ABS assignkeywords ) )
            int alt27=4;
            switch ( input.LA(1) ) {
            case LEN:
                {
                alt27=1;
                }
                break;
            case NOTEMPTY:
                {
                alt27=2;
                }
                break;
            case EMPTY:
                {
                alt27=3;
                }
                break;
            case ABS:
                {
                alt27=4;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 27, 0, input);

                throw nvae;
            }

            switch (alt27) {
                case 1 :
                    // RiseCollectionFormula.g:180:4: LEN '(' assignkeywords ')'
                    {
                    LEN148=(Token)match(input,LEN,FOLLOW_LEN_in_functionExpression1221); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_LEN.add(LEN148);

                    char_literal149=(Token)match(input,46,FOLLOW_46_in_functionExpression1222); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_46.add(char_literal149);

                    pushFollow(FOLLOW_assignkeywords_in_functionExpression1223);
                    assignkeywords150=assignkeywords();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) stream_assignkeywords.add(assignkeywords150.getTree());
                    char_literal151=(Token)match(input,47,FOLLOW_47_in_functionExpression1224); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_47.add(char_literal151);



                    // AST REWRITE
                    // elements: assignkeywords, LEN
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    if ( state.backtracking==0 ) {
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (Object)adaptor.nil();
                    // 181:3: -> ^( LEN assignkeywords )
                    {
                        // RiseCollectionFormula.g:181:5: ^( LEN assignkeywords )
                        {
                        Object root_1 = (Object)adaptor.nil();
                        root_1 = (Object)adaptor.becomeRoot(stream_LEN.nextNode(), root_1);

                        adaptor.addChild(root_1, stream_assignkeywords.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }

                    retval.tree = root_0;}
                    }
                    break;
                case 2 :
                    // RiseCollectionFormula.g:182:4: NOTEMPTY '(' assignkeywords ')'
                    {
                    NOTEMPTY152=(Token)match(input,NOTEMPTY,FOLLOW_NOTEMPTY_in_functionExpression1238); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_NOTEMPTY.add(NOTEMPTY152);

                    char_literal153=(Token)match(input,46,FOLLOW_46_in_functionExpression1239); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_46.add(char_literal153);

                    pushFollow(FOLLOW_assignkeywords_in_functionExpression1240);
                    assignkeywords154=assignkeywords();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) stream_assignkeywords.add(assignkeywords154.getTree());
                    char_literal155=(Token)match(input,47,FOLLOW_47_in_functionExpression1241); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_47.add(char_literal155);



                    // AST REWRITE
                    // elements: assignkeywords, NOTEMPTY
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    if ( state.backtracking==0 ) {
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (Object)adaptor.nil();
                    // 183:3: -> ^( NOTEMPTY assignkeywords )
                    {
                        // RiseCollectionFormula.g:183:5: ^( NOTEMPTY assignkeywords )
                        {
                        Object root_1 = (Object)adaptor.nil();
                        root_1 = (Object)adaptor.becomeRoot(stream_NOTEMPTY.nextNode(), root_1);

                        adaptor.addChild(root_1, stream_assignkeywords.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }

                    retval.tree = root_0;}
                    }
                    break;
                case 3 :
                    // RiseCollectionFormula.g:184:4: EMPTY '(' assignkeywords ')'
                    {
                    EMPTY156=(Token)match(input,EMPTY,FOLLOW_EMPTY_in_functionExpression1255); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_EMPTY.add(EMPTY156);

                    char_literal157=(Token)match(input,46,FOLLOW_46_in_functionExpression1256); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_46.add(char_literal157);

                    pushFollow(FOLLOW_assignkeywords_in_functionExpression1257);
                    assignkeywords158=assignkeywords();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) stream_assignkeywords.add(assignkeywords158.getTree());
                    char_literal159=(Token)match(input,47,FOLLOW_47_in_functionExpression1258); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_47.add(char_literal159);



                    // AST REWRITE
                    // elements: EMPTY, assignkeywords
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    if ( state.backtracking==0 ) {
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (Object)adaptor.nil();
                    // 185:3: -> ^( EMPTY assignkeywords )
                    {
                        // RiseCollectionFormula.g:185:5: ^( EMPTY assignkeywords )
                        {
                        Object root_1 = (Object)adaptor.nil();
                        root_1 = (Object)adaptor.becomeRoot(stream_EMPTY.nextNode(), root_1);

                        adaptor.addChild(root_1, stream_assignkeywords.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }

                    retval.tree = root_0;}
                    }
                    break;
                case 4 :
                    // RiseCollectionFormula.g:186:4: ABS '(' assignkeywords ')'
                    {
                    ABS160=(Token)match(input,ABS,FOLLOW_ABS_in_functionExpression1272); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_ABS.add(ABS160);

                    char_literal161=(Token)match(input,46,FOLLOW_46_in_functionExpression1273); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_46.add(char_literal161);

                    pushFollow(FOLLOW_assignkeywords_in_functionExpression1274);
                    assignkeywords162=assignkeywords();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) stream_assignkeywords.add(assignkeywords162.getTree());
                    char_literal163=(Token)match(input,47,FOLLOW_47_in_functionExpression1275); if (state.failed) return retval; 
                    if ( state.backtracking==0 ) stream_47.add(char_literal163);



                    // AST REWRITE
                    // elements: ABS, assignkeywords
                    // token labels: 
                    // rule labels: retval
                    // token list labels: 
                    // rule list labels: 
                    if ( state.backtracking==0 ) {
                    retval.tree = root_0;
                    RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"token retval",retval!=null?retval.tree:null);

                    root_0 = (Object)adaptor.nil();
                    // 187:3: -> ^( ABS assignkeywords )
                    {
                        // RiseCollectionFormula.g:187:5: ^( ABS assignkeywords )
                        {
                        Object root_1 = (Object)adaptor.nil();
                        root_1 = (Object)adaptor.becomeRoot(stream_ABS.nextNode(), root_1);

                        adaptor.addChild(root_1, stream_assignkeywords.nextTree());

                        adaptor.addChild(root_0, root_1);
                        }

                    }

                    retval.tree = root_0;}
                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "functionExpression"

    public static class literal_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "literal"
    // RiseCollectionFormula.g:243:1: literal : ( DecimalLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | booleanLiteral | 'null' );
    public final RiseCollectionFormulaParser.literal_return literal() throws RecognitionException {
        RiseCollectionFormulaParser.literal_return retval = new RiseCollectionFormulaParser.literal_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token DecimalLiteral164=null;
        Token FloatingPointLiteral165=null;
        Token CharacterLiteral166=null;
        Token StringLiteral167=null;
        Token string_literal169=null;
        RiseCollectionFormulaParser.booleanLiteral_return booleanLiteral168 = null;


        Object DecimalLiteral164_tree=null;
        Object FloatingPointLiteral165_tree=null;
        Object CharacterLiteral166_tree=null;
        Object StringLiteral167_tree=null;
        Object string_literal169_tree=null;

        try {
            // RiseCollectionFormula.g:244:6: ( DecimalLiteral | FloatingPointLiteral | CharacterLiteral | StringLiteral | booleanLiteral | 'null' )
            int alt28=6;
            switch ( input.LA(1) ) {
            case DecimalLiteral:
                {
                alt28=1;
                }
                break;
            case FloatingPointLiteral:
                {
                alt28=2;
                }
                break;
            case CharacterLiteral:
                {
                alt28=3;
                }
                break;
            case StringLiteral:
                {
                alt28=4;
                }
                break;
            case 66:
            case 67:
                {
                alt28=5;
                }
                break;
            case 65:
                {
                alt28=6;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 28, 0, input);

                throw nvae;
            }

            switch (alt28) {
                case 1 :
                    // RiseCollectionFormula.g:244:11: DecimalLiteral
                    {
                    root_0 = (Object)adaptor.nil();

                    DecimalLiteral164=(Token)match(input,DecimalLiteral,FOLLOW_DecimalLiteral_in_literal1779); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    DecimalLiteral164_tree = (Object)adaptor.create(DecimalLiteral164);
                    adaptor.addChild(root_0, DecimalLiteral164_tree);
                    }

                    }
                    break;
                case 2 :
                    // RiseCollectionFormula.g:245:11: FloatingPointLiteral
                    {
                    root_0 = (Object)adaptor.nil();

                    FloatingPointLiteral165=(Token)match(input,FloatingPointLiteral,FOLLOW_FloatingPointLiteral_in_literal1791); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FloatingPointLiteral165_tree = (Object)adaptor.create(FloatingPointLiteral165);
                    adaptor.addChild(root_0, FloatingPointLiteral165_tree);
                    }

                    }
                    break;
                case 3 :
                    // RiseCollectionFormula.g:246:11: CharacterLiteral
                    {
                    root_0 = (Object)adaptor.nil();

                    CharacterLiteral166=(Token)match(input,CharacterLiteral,FOLLOW_CharacterLiteral_in_literal1803); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    CharacterLiteral166_tree = (Object)adaptor.create(CharacterLiteral166);
                    adaptor.addChild(root_0, CharacterLiteral166_tree);
                    }

                    }
                    break;
                case 4 :
                    // RiseCollectionFormula.g:247:11: StringLiteral
                    {
                    root_0 = (Object)adaptor.nil();

                    StringLiteral167=(Token)match(input,StringLiteral,FOLLOW_StringLiteral_in_literal1815); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    StringLiteral167_tree = (Object)adaptor.create(StringLiteral167);
                    adaptor.addChild(root_0, StringLiteral167_tree);
                    }

                    }
                    break;
                case 5 :
                    // RiseCollectionFormula.g:248:11: booleanLiteral
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_booleanLiteral_in_literal1827);
                    booleanLiteral168=booleanLiteral();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, booleanLiteral168.getTree());

                    }
                    break;
                case 6 :
                    // RiseCollectionFormula.g:249:11: 'null'
                    {
                    root_0 = (Object)adaptor.nil();

                    string_literal169=(Token)match(input,65,FOLLOW_65_in_literal1839); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    string_literal169_tree = (Object)adaptor.create(string_literal169);
                    adaptor.addChild(root_0, string_literal169_tree);
                    }

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "literal"

    public static class booleanLiteral_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "booleanLiteral"
    // RiseCollectionFormula.g:267:1: booleanLiteral : ( 'true' | 'false' );
    public final RiseCollectionFormulaParser.booleanLiteral_return booleanLiteral() throws RecognitionException {
        RiseCollectionFormulaParser.booleanLiteral_return retval = new RiseCollectionFormulaParser.booleanLiteral_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token set170=null;

        Object set170_tree=null;

        try {
            // RiseCollectionFormula.g:268:5: ( 'true' | 'false' )
            // RiseCollectionFormula.g:
            {
            root_0 = (Object)adaptor.nil();

            set170=(Token)input.LT(1);
            if ( (input.LA(1)>=66 && input.LA(1)<=67) ) {
                input.consume();
                if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(set170));
                state.errorRecovery=false;state.failed=false;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "booleanLiteral"

    // $ANTLR start synpred13_RiseCollectionFormula
    public final void synpred13_RiseCollectionFormula_fragment() throws RecognitionException {   
        // RiseCollectionFormula.g:48:4: ( assignkeywords '=' assignkeywords )
        // RiseCollectionFormula.g:48:4: assignkeywords '=' assignkeywords
        {
        pushFollow(FOLLOW_assignkeywords_in_synpred13_RiseCollectionFormula216);
        assignkeywords();

        state._fsp--;
        if (state.failed) return ;
        match(input,43,FOLLOW_43_in_synpred13_RiseCollectionFormula218); if (state.failed) return ;
        pushFollow(FOLLOW_assignkeywords_in_synpred13_RiseCollectionFormula220);
        assignkeywords();

        state._fsp--;
        if (state.failed) return ;

        }
    }
    // $ANTLR end synpred13_RiseCollectionFormula

    // $ANTLR start synpred14_RiseCollectionFormula
    public final void synpred14_RiseCollectionFormula_fragment() throws RecognitionException {   
        // RiseCollectionFormula.g:49:4: ( assignkeywords '=' referenceassign )
        // RiseCollectionFormula.g:49:4: assignkeywords '=' referenceassign
        {
        pushFollow(FOLLOW_assignkeywords_in_synpred14_RiseCollectionFormula225);
        assignkeywords();

        state._fsp--;
        if (state.failed) return ;
        match(input,43,FOLLOW_43_in_synpred14_RiseCollectionFormula227); if (state.failed) return ;
        pushFollow(FOLLOW_referenceassign_in_synpred14_RiseCollectionFormula229);
        referenceassign();

        state._fsp--;
        if (state.failed) return ;

        }
    }
    // $ANTLR end synpred14_RiseCollectionFormula

    // $ANTLR start synpred15_RiseCollectionFormula
    public final void synpred15_RiseCollectionFormula_fragment() throws RecognitionException {   
        // RiseCollectionFormula.g:51:4: ( reportkeywords '=' Identifier )
        // RiseCollectionFormula.g:51:4: reportkeywords '=' Identifier
        {
        pushFollow(FOLLOW_reportkeywords_in_synpred15_RiseCollectionFormula245);
        reportkeywords();

        state._fsp--;
        if (state.failed) return ;
        match(input,43,FOLLOW_43_in_synpred15_RiseCollectionFormula247); if (state.failed) return ;
        match(input,Identifier,FOLLOW_Identifier_in_synpred15_RiseCollectionFormula249); if (state.failed) return ;

        }
    }
    // $ANTLR end synpred15_RiseCollectionFormula

    // $ANTLR start synpred16_RiseCollectionFormula
    public final void synpred16_RiseCollectionFormula_fragment() throws RecognitionException {   
        // RiseCollectionFormula.g:52:4: ( reportkeywords '=' expression )
        // RiseCollectionFormula.g:52:4: reportkeywords '=' expression
        {
        pushFollow(FOLLOW_reportkeywords_in_synpred16_RiseCollectionFormula254);
        reportkeywords();

        state._fsp--;
        if (state.failed) return ;
        match(input,43,FOLLOW_43_in_synpred16_RiseCollectionFormula256); if (state.failed) return ;
        pushFollow(FOLLOW_expression_in_synpred16_RiseCollectionFormula258);
        expression();

        state._fsp--;
        if (state.failed) return ;

        }
    }
    // $ANTLR end synpred16_RiseCollectionFormula

    // $ANTLR start synpred39_RiseCollectionFormula
    public final void synpred39_RiseCollectionFormula_fragment() throws RecognitionException {   
        // RiseCollectionFormula.g:121:35: ( '+' multiplicativeExpression )
        // RiseCollectionFormula.g:121:35: '+' multiplicativeExpression
        {
        match(input,60,FOLLOW_60_in_synpred39_RiseCollectionFormula798); if (state.failed) return ;
        pushFollow(FOLLOW_multiplicativeExpression_in_synpred39_RiseCollectionFormula801);
        multiplicativeExpression();

        state._fsp--;
        if (state.failed) return ;

        }
    }
    // $ANTLR end synpred39_RiseCollectionFormula

    // $ANTLR start synpred40_RiseCollectionFormula
    public final void synpred40_RiseCollectionFormula_fragment() throws RecognitionException {   
        // RiseCollectionFormula.g:121:67: ( '-' multiplicativeExpression )
        // RiseCollectionFormula.g:121:67: '-' multiplicativeExpression
        {
        match(input,45,FOLLOW_45_in_synpred40_RiseCollectionFormula805); if (state.failed) return ;
        pushFollow(FOLLOW_multiplicativeExpression_in_synpred40_RiseCollectionFormula808);
        multiplicativeExpression();

        state._fsp--;
        if (state.failed) return ;

        }
    }
    // $ANTLR end synpred40_RiseCollectionFormula

    // Delegated rules

    public final boolean synpred14_RiseCollectionFormula() {
        state.backtracking++;
        int start = input.mark();
        try {
            synpred14_RiseCollectionFormula_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !state.failed;
        input.rewind(start);
        state.backtracking--;
        state.failed=false;
        return success;
    }
    public final boolean synpred15_RiseCollectionFormula() {
        state.backtracking++;
        int start = input.mark();
        try {
            synpred15_RiseCollectionFormula_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !state.failed;
        input.rewind(start);
        state.backtracking--;
        state.failed=false;
        return success;
    }
    public final boolean synpred40_RiseCollectionFormula() {
        state.backtracking++;
        int start = input.mark();
        try {
            synpred40_RiseCollectionFormula_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !state.failed;
        input.rewind(start);
        state.backtracking--;
        state.failed=false;
        return success;
    }
    public final boolean synpred13_RiseCollectionFormula() {
        state.backtracking++;
        int start = input.mark();
        try {
            synpred13_RiseCollectionFormula_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !state.failed;
        input.rewind(start);
        state.backtracking--;
        state.failed=false;
        return success;
    }
    public final boolean synpred39_RiseCollectionFormula() {
        state.backtracking++;
        int start = input.mark();
        try {
            synpred39_RiseCollectionFormula_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !state.failed;
        input.rewind(start);
        state.backtracking--;
        state.failed=false;
        return success;
    }
    public final boolean synpred16_RiseCollectionFormula() {
        state.backtracking++;
        int start = input.mark();
        try {
            synpred16_RiseCollectionFormula_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !state.failed;
        input.rewind(start);
        state.backtracking--;
        state.failed=false;
        return success;
    }


    protected DFA8 dfa8 = new DFA8(this);
    protected DFA22 dfa22 = new DFA22(this);
    static final String DFA8_eotS =
        "\17\uffff";
    static final String DFA8_eofS =
        "\17\uffff";
    static final String DFA8_minS =
        "\1\14\2\53\2\14\3\0\1\uffff\1\0\5\uffff";
    static final String DFA8_maxS =
        "\1\26\2\53\2\103\3\0\1\uffff\1\0\5\uffff";
    static final String DFA8_acceptS =
        "\10\uffff\1\4\1\uffff\1\5\1\6\1\3\1\1\1\2";
    static final String DFA8_specialS =
        "\5\uffff\1\3\1\1\1\2\1\uffff\1\0\5\uffff}>";
    static final String[] DFA8_transitionS = {
            "\1\2\10\uffff\2\1",
            "\1\3",
            "\1\4",
            "\1\5\2\uffff\1\10\2\uffff\1\10\2\uffff\1\6\1\11\5\7\4\10\2"+
            "\uffff\2\10\11\uffff\2\10\15\uffff\1\10\4\uffff\3\10",
            "\1\12\2\uffff\1\13\2\uffff\1\13\17\uffff\2\13\35\uffff\3\13",
            "\1\uffff",
            "\1\uffff",
            "\1\uffff",
            "",
            "\1\uffff",
            "",
            "",
            "",
            "",
            ""
    };

    static final short[] DFA8_eot = DFA.unpackEncodedString(DFA8_eotS);
    static final short[] DFA8_eof = DFA.unpackEncodedString(DFA8_eofS);
    static final char[] DFA8_min = DFA.unpackEncodedStringToUnsignedChars(DFA8_minS);
    static final char[] DFA8_max = DFA.unpackEncodedStringToUnsignedChars(DFA8_maxS);
    static final short[] DFA8_accept = DFA.unpackEncodedString(DFA8_acceptS);
    static final short[] DFA8_special = DFA.unpackEncodedString(DFA8_specialS);
    static final short[][] DFA8_transition;

    static {
        int numStates = DFA8_transitionS.length;
        DFA8_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA8_transition[i] = DFA.unpackEncodedString(DFA8_transitionS[i]);
        }
    }

    class DFA8 extends DFA {

        public DFA8(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 8;
            this.eot = DFA8_eot;
            this.eof = DFA8_eof;
            this.min = DFA8_min;
            this.max = DFA8_max;
            this.accept = DFA8_accept;
            this.special = DFA8_special;
            this.transition = DFA8_transition;
        }
        public String getDescription() {
            return "47:1: assignStatement : ( assignkeywords '=' assignkeywords | assignkeywords '=' referenceassign -> ^( '=' assignkeywords referenceassign ) | reportkeywords '=' Identifier | reportkeywords '=' expression | Identifier '=' Identifier | Identifier '=' literal );";
        }
        public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
            TokenStream input = (TokenStream)_input;
        	int _s = s;
            switch ( s ) {
                    case 0 : 
                        int LA8_9 = input.LA(1);

                         
                        int index8_9 = input.index();
                        input.rewind();
                        s = -1;
                        if ( (synpred13_RiseCollectionFormula()) ) {s = 13;}

                        else if ( (synpred16_RiseCollectionFormula()) ) {s = 8;}

                         
                        input.seek(index8_9);
                        if ( s>=0 ) return s;
                        break;
                    case 1 : 
                        int LA8_6 = input.LA(1);

                         
                        int index8_6 = input.index();
                        input.rewind();
                        s = -1;
                        if ( (synpred13_RiseCollectionFormula()) ) {s = 13;}

                        else if ( (synpred16_RiseCollectionFormula()) ) {s = 8;}

                         
                        input.seek(index8_6);
                        if ( s>=0 ) return s;
                        break;
                    case 2 : 
                        int LA8_7 = input.LA(1);

                         
                        int index8_7 = input.index();
                        input.rewind();
                        s = -1;
                        if ( (synpred14_RiseCollectionFormula()) ) {s = 14;}

                        else if ( (synpred16_RiseCollectionFormula()) ) {s = 8;}

                         
                        input.seek(index8_7);
                        if ( s>=0 ) return s;
                        break;
                    case 3 : 
                        int LA8_5 = input.LA(1);

                         
                        int index8_5 = input.index();
                        input.rewind();
                        s = -1;
                        if ( (synpred15_RiseCollectionFormula()) ) {s = 12;}

                        else if ( (synpred16_RiseCollectionFormula()) ) {s = 8;}

                         
                        input.seek(index8_5);
                        if ( s>=0 ) return s;
                        break;
            }
            if (state.backtracking>0) {state.failed=true; return -1;}
            NoViableAltException nvae =
                new NoViableAltException(getDescription(), 8, _s, input);
            error(nvae);
            throw nvae;
        }
    }
    static final String DFA22_eotS =
        "\51\uffff";
    static final String DFA22_eofS =
        "\1\3\50\uffff";
    static final String DFA22_minS =
        "\1\5\2\0\46\uffff";
    static final String DFA22_maxS =
        "\1\103\2\0\46\uffff";
    static final String DFA22_acceptS =
        "\3\uffff\1\3\43\uffff\1\1\1\2";
    static final String DFA22_specialS =
        "\1\uffff\1\0\1\1\46\uffff}>";
    static final String[] DFA22_transitionS = {
            "\10\3\1\uffff\2\3\1\uffff\2\3\2\uffff\13\3\2\uffff\2\3\11\uffff"+
            "\1\2\3\3\2\uffff\11\3\1\1\4\uffff\3\3",
            "\1\uffff",
            "\1\uffff",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            ""
    };

    static final short[] DFA22_eot = DFA.unpackEncodedString(DFA22_eotS);
    static final short[] DFA22_eof = DFA.unpackEncodedString(DFA22_eofS);
    static final char[] DFA22_min = DFA.unpackEncodedStringToUnsignedChars(DFA22_minS);
    static final char[] DFA22_max = DFA.unpackEncodedStringToUnsignedChars(DFA22_maxS);
    static final short[] DFA22_accept = DFA.unpackEncodedString(DFA22_acceptS);
    static final short[] DFA22_special = DFA.unpackEncodedString(DFA22_specialS);
    static final short[][] DFA22_transition;

    static {
        int numStates = DFA22_transitionS.length;
        DFA22_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA22_transition[i] = DFA.unpackEncodedString(DFA22_transitionS[i]);
        }
    }

    class DFA22 extends DFA {

        public DFA22(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 22;
            this.eot = DFA22_eot;
            this.eof = DFA22_eof;
            this.min = DFA22_min;
            this.max = DFA22_max;
            this.accept = DFA22_accept;
            this.special = DFA22_special;
            this.transition = DFA22_transition;
        }
        public String getDescription() {
            return "()* loopback of 121:34: ( '+' multiplicativeExpression | '-' multiplicativeExpression )*";
        }
        public int specialStateTransition(int s, IntStream _input) throws NoViableAltException {
            TokenStream input = (TokenStream)_input;
        	int _s = s;
            switch ( s ) {
                    case 0 : 
                        int LA22_1 = input.LA(1);

                         
                        int index22_1 = input.index();
                        input.rewind();
                        s = -1;
                        if ( (synpred39_RiseCollectionFormula()) ) {s = 39;}

                        else if ( (true) ) {s = 3;}

                         
                        input.seek(index22_1);
                        if ( s>=0 ) return s;
                        break;
                    case 1 : 
                        int LA22_2 = input.LA(1);

                         
                        int index22_2 = input.index();
                        input.rewind();
                        s = -1;
                        if ( (synpred40_RiseCollectionFormula()) ) {s = 40;}

                        else if ( (true) ) {s = 3;}

                         
                        input.seek(index22_2);
                        if ( s>=0 ) return s;
                        break;
            }
            if (state.backtracking>0) {state.failed=true; return -1;}
            NoViableAltException nvae =
                new NoViableAltException(getDescription(), 22, _s, input);
            error(nvae);
            throw nvae;
        }
    }
 

    public static final BitSet FOLLOW_statement_in_prog51 = new BitSet(new long[]{0x00000000006252A0L});
    public static final BitSet FOLLOW_EOF_in_prog54 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ifStatement_in_statement65 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FOR_in_statement70 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_inListStatement_in_statement72 = new BitSet(new long[]{0x00000000006252E0L});
    public static final BitSet FOLLOW_statement_in_statement74 = new BitSet(new long[]{0x00000000006252E0L});
    public static final BitSet FOLLOW_ENDFOR_in_statement77 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FOREACH_in_statement94 = new BitSet(new long[]{0x00000000006253A0L});
    public static final BitSet FOLLOW_statement_in_statement96 = new BitSet(new long[]{0x00000000006253A0L});
    public static final BitSet FOLLOW_ENDFOREACH_in_statement99 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_assignStatement_in_statement117 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_asAssignStatement_in_statement122 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_openStatement_in_statement127 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_functionStatement_in_statement132 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IF_in_ifStatement144 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_expression_in_ifStatement146 = new BitSet(new long[]{0x0000000000625EA0L});
    public static final BitSet FOLLOW_statement_in_ifStatement148 = new BitSet(new long[]{0x0000000000625EA0L});
    public static final BitSet FOLLOW_elseStatement_in_ifStatement160 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_ENDIF_in_ifStatement164 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ELSE_in_elseStatement191 = new BitSet(new long[]{0x00000000006252A2L});
    public static final BitSet FOLLOW_statement_in_elseStatement193 = new BitSet(new long[]{0x00000000006252A2L});
    public static final BitSet FOLLOW_assignkeywords_in_assignStatement216 = new BitSet(new long[]{0x0000080000000000L});
    public static final BitSet FOLLOW_43_in_assignStatement218 = new BitSet(new long[]{0x0000000000600000L});
    public static final BitSet FOLLOW_assignkeywords_in_assignStatement220 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_assignkeywords_in_assignStatement225 = new BitSet(new long[]{0x0000080000000000L});
    public static final BitSet FOLLOW_43_in_assignStatement227 = new BitSet(new long[]{0x000000000F800000L});
    public static final BitSet FOLLOW_referenceassign_in_assignStatement229 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_reportkeywords_in_assignStatement245 = new BitSet(new long[]{0x0000080000000000L});
    public static final BitSet FOLLOW_43_in_assignStatement247 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_Identifier_in_assignStatement249 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_reportkeywords_in_assignStatement254 = new BitSet(new long[]{0x0000080000000000L});
    public static final BitSet FOLLOW_43_in_assignStatement256 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_expression_in_assignStatement258 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_Identifier_in_assignStatement263 = new BitSet(new long[]{0x0000080000000000L});
    public static final BitSet FOLLOW_43_in_assignStatement265 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_Identifier_in_assignStatement267 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_Identifier_in_assignStatement272 = new BitSet(new long[]{0x0000080000000000L});
    public static final BitSet FOLLOW_43_in_assignStatement274 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_literal_in_assignStatement276 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_Identifier_in_asAssignStatement288 = new BitSet(new long[]{0x0000000000002000L});
    public static final BitSet FOLLOW_AS_in_asAssignStatement290 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_Identifier_in_asAssignStatement292 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_Identifier_in_asAssignStatement308 = new BitSet(new long[]{0x0000100000000000L});
    public static final BitSet FOLLOW_44_in_asAssignStatement310 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_Identifier_in_asAssignStatement312 = new BitSet(new long[]{0x0000000000002000L});
    public static final BitSet FOLLOW_AS_in_asAssignStatement314 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_Identifier_in_asAssignStatement316 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_OPEN_in_openStatement341 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_Identifier_in_openStatement343 = new BitSet(new long[]{0x0000080000000000L});
    public static final BitSet FOLLOW_43_in_openStatement345 = new BitSet(new long[]{0x0000200000001000L});
    public static final BitSet FOLLOW_45_in_openStatement348 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_DecimalLiteral_in_openStatement350 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_Identifier_in_openStatement357 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_Identifier_in_openStatement364 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_45_in_openStatement366 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_DecimalLiteral_in_openStatement368 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_OPEN_in_openStatement389 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_Identifier_in_openStatement391 = new BitSet(new long[]{0x0000080000000000L});
    public static final BitSet FOLLOW_43_in_openStatement393 = new BitSet(new long[]{0x0000000000010000L});
    public static final BitSet FOLLOW_LY_in_openStatement395 = new BitSet(new long[]{0x0000400000000000L});
    public static final BitSet FOLLOW_46_in_openStatement397 = new BitSet(new long[]{0x0000800000001000L});
    public static final BitSet FOLLOW_47_in_openStatement401 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_Identifier_in_openStatement408 = new BitSet(new long[]{0x0000800000000000L});
    public static final BitSet FOLLOW_47_in_openStatement410 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_47_in_openStatement417 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_45_in_openStatement419 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_DecimalLiteral_in_openStatement421 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_Identifier_in_openStatement428 = new BitSet(new long[]{0x0000800000000000L});
    public static final BitSet FOLLOW_47_in_openStatement430 = new BitSet(new long[]{0x0000200000000000L});
    public static final BitSet FOLLOW_45_in_openStatement432 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_DecimalLiteral_in_openStatement434 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_SURE_in_functionStatement464 = new BitSet(new long[]{0x0000400000000000L});
    public static final BitSet FOLLOW_46_in_functionStatement465 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_expression_in_functionStatement466 = new BitSet(new long[]{0x0001000000000000L});
    public static final BitSet FOLLOW_48_in_functionStatement469 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_expression_in_functionStatement471 = new BitSet(new long[]{0x0001000000000000L});
    public static final BitSet FOLLOW_48_in_functionStatement475 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_StringLiteral_in_functionStatement477 = new BitSet(new long[]{0x0000800000000000L});
    public static final BitSet FOLLOW_47_in_functionStatement478 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_Identifier_in_inListStatement502 = new BitSet(new long[]{0x0000000000080000L});
    public static final BitSet FOLLOW_IN_in_inListStatement504 = new BitSet(new long[]{0x0002000000000000L});
    public static final BitSet FOLLOW_forInScope_in_inListStatement506 = new BitSet(new long[]{0x0000000000008002L});
    public static final BitSet FOLLOW_DecimalLiteral_in_inListStatement508 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_scopeDigital_in_forInScope536 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_listDigital_in_forInScope538 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_49_in_scopeDigital550 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_DecimalLiteral_in_scopeDigital551 = new BitSet(new long[]{0x0000000000100000L});
    public static final BitSet FOLLOW_TO_in_scopeDigital553 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_DecimalLiteral_in_scopeDigital555 = new BitSet(new long[]{0x0004000000000000L});
    public static final BitSet FOLLOW_50_in_scopeDigital556 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_49_in_listDigital579 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_DecimalLiteral_in_listDigital580 = new BitSet(new long[]{0x0005000000000000L});
    public static final BitSet FOLLOW_48_in_listDigital582 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_DecimalLiteral_in_listDigital583 = new BitSet(new long[]{0x0005000000000000L});
    public static final BitSet FOLLOW_50_in_listDigital586 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_conditionalOrExpression_in_expression608 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_conditionalAndExpression_in_conditionalOrExpression625 = new BitSet(new long[]{0x0008000000000002L});
    public static final BitSet FOLLOW_51_in_conditionalOrExpression629 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_conditionalAndExpression_in_conditionalOrExpression632 = new BitSet(new long[]{0x0008000000000002L});
    public static final BitSet FOLLOW_equalityExpression_in_conditionalAndExpression660 = new BitSet(new long[]{0x0010000000000002L});
    public static final BitSet FOLLOW_52_in_conditionalAndExpression664 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_equalityExpression_in_conditionalAndExpression667 = new BitSet(new long[]{0x0010000000000002L});
    public static final BitSet FOLLOW_relationalExpression_in_equalityExpression695 = new BitSet(new long[]{0x0FE0000000000002L});
    public static final BitSet FOLLOW_53_in_equalityExpression700 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_54_in_equalityExpression705 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_55_in_equalityExpression710 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_56_in_equalityExpression715 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_57_in_equalityExpression720 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_58_in_equalityExpression725 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_59_in_equalityExpression730 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_relationalExpression_in_equalityExpression734 = new BitSet(new long[]{0x0FE0000000000002L});
    public static final BitSet FOLLOW_additiveExpression_in_relationalExpression762 = new BitSet(new long[]{0x1000600CFFE49002L,0x000000000000000EL});
    public static final BitSet FOLLOW_additiveExpression_in_relationalExpression766 = new BitSet(new long[]{0x1000600CFFE49002L,0x000000000000000EL});
    public static final BitSet FOLLOW_multiplicativeExpression_in_additiveExpression796 = new BitSet(new long[]{0x1000200000000002L});
    public static final BitSet FOLLOW_60_in_additiveExpression798 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_multiplicativeExpression_in_additiveExpression801 = new BitSet(new long[]{0x1000200000000002L});
    public static final BitSet FOLLOW_45_in_additiveExpression805 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_multiplicativeExpression_in_additiveExpression808 = new BitSet(new long[]{0x1000200000000002L});
    public static final BitSet FOLLOW_unaryExpression_in_multiplicativeExpression833 = new BitSet(new long[]{0xE000000000000002L});
    public static final BitSet FOLLOW_61_in_multiplicativeExpression835 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_unaryExpression_in_multiplicativeExpression838 = new BitSet(new long[]{0xE000000000000002L});
    public static final BitSet FOLLOW_62_in_multiplicativeExpression842 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_unaryExpression_in_multiplicativeExpression845 = new BitSet(new long[]{0xE000000000000002L});
    public static final BitSet FOLLOW_63_in_multiplicativeExpression849 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_unaryExpression_in_multiplicativeExpression852 = new BitSet(new long[]{0xE000000000000002L});
    public static final BitSet FOLLOW_continuousAddExpression_in_multiplicativeExpression863 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_RANGECELL_in_continuousAddExpression883 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
    public static final BitSet FOLLOW_64_in_continuousAddExpression885 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_RANGECELL_in_continuousAddExpression887 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_60_in_unaryExpression920 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_unaryExpression_in_unaryExpression923 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_45_in_unaryExpression934 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_unaryExpression_in_unaryExpression937 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_primary_in_unaryExpression948 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_parExpression_in_primary974 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_functionExpression_in_primary983 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_Identifier_in_primary995 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_reportkeywords_in_primary1004 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_reference_in_primary1013 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_literal_in_primary1025 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_assignkeywords0 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_reportkeywords0 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_referenceassign0 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_reference0 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_46_in_parExpression1190 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_expression_in_parExpression1192 = new BitSet(new long[]{0x0000800000000000L});
    public static final BitSet FOLLOW_47_in_parExpression1194 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_LEN_in_functionExpression1221 = new BitSet(new long[]{0x0000400000000000L});
    public static final BitSet FOLLOW_46_in_functionExpression1222 = new BitSet(new long[]{0x0000000000600000L});
    public static final BitSet FOLLOW_assignkeywords_in_functionExpression1223 = new BitSet(new long[]{0x0000800000000000L});
    public static final BitSet FOLLOW_47_in_functionExpression1224 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_NOTEMPTY_in_functionExpression1238 = new BitSet(new long[]{0x0000400000000000L});
    public static final BitSet FOLLOW_46_in_functionExpression1239 = new BitSet(new long[]{0x0000000000600000L});
    public static final BitSet FOLLOW_assignkeywords_in_functionExpression1240 = new BitSet(new long[]{0x0000800000000000L});
    public static final BitSet FOLLOW_47_in_functionExpression1241 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_EMPTY_in_functionExpression1255 = new BitSet(new long[]{0x0000400000000000L});
    public static final BitSet FOLLOW_46_in_functionExpression1256 = new BitSet(new long[]{0x0000000000600000L});
    public static final BitSet FOLLOW_assignkeywords_in_functionExpression1257 = new BitSet(new long[]{0x0000800000000000L});
    public static final BitSet FOLLOW_47_in_functionExpression1258 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ABS_in_functionExpression1272 = new BitSet(new long[]{0x0000400000000000L});
    public static final BitSet FOLLOW_46_in_functionExpression1273 = new BitSet(new long[]{0x0000000000600000L});
    public static final BitSet FOLLOW_assignkeywords_in_functionExpression1274 = new BitSet(new long[]{0x0000800000000000L});
    public static final BitSet FOLLOW_47_in_functionExpression1275 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_DecimalLiteral_in_literal1779 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FloatingPointLiteral_in_literal1791 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_CharacterLiteral_in_literal1803 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_StringLiteral_in_literal1815 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_booleanLiteral_in_literal1827 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_65_in_literal1839 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_booleanLiteral0 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_assignkeywords_in_synpred13_RiseCollectionFormula216 = new BitSet(new long[]{0x0000080000000000L});
    public static final BitSet FOLLOW_43_in_synpred13_RiseCollectionFormula218 = new BitSet(new long[]{0x0000000000600000L});
    public static final BitSet FOLLOW_assignkeywords_in_synpred13_RiseCollectionFormula220 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_assignkeywords_in_synpred14_RiseCollectionFormula225 = new BitSet(new long[]{0x0000080000000000L});
    public static final BitSet FOLLOW_43_in_synpred14_RiseCollectionFormula227 = new BitSet(new long[]{0x000000000F800000L});
    public static final BitSet FOLLOW_referenceassign_in_synpred14_RiseCollectionFormula229 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_reportkeywords_in_synpred15_RiseCollectionFormula245 = new BitSet(new long[]{0x0000080000000000L});
    public static final BitSet FOLLOW_43_in_synpred15_RiseCollectionFormula247 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_Identifier_in_synpred15_RiseCollectionFormula249 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_reportkeywords_in_synpred16_RiseCollectionFormula254 = new BitSet(new long[]{0x0000080000000000L});
    public static final BitSet FOLLOW_43_in_synpred16_RiseCollectionFormula256 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_expression_in_synpred16_RiseCollectionFormula258 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_60_in_synpred39_RiseCollectionFormula798 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_multiplicativeExpression_in_synpred39_RiseCollectionFormula801 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_45_in_synpred40_RiseCollectionFormula805 = new BitSet(new long[]{0x1000600CFFE49000L,0x000000000000000EL});
    public static final BitSet FOLLOW_multiplicativeExpression_in_synpred40_RiseCollectionFormula808 = new BitSet(new long[]{0x0000000000000002L});

}